Array.from(document.getElementsByTagName("input"))
.filter( input => { return input.type==="checkbox" } )
.map( checkbox => { checkbox.checked = true })
carbon-based lifeform. virgo supercluster
Array.from(document.getElementsByTagName("input"))
.filter( input => { return input.type==="checkbox" } )
.map( checkbox => { checkbox.checked = true })
class A
def foo
[1, 2, 3]
end
end
class B < A
def foo
super.map{ |n| n * 2 }
end
end
puts A.new.foo.to_s
puts B.new.foo.to_s
Output
[1, 2, 3]
[2, 4, 6]
Move files in current subdirectories to the current directory.
find . -mindepth 2 -type f -exec mv -t . -i '{}' +
Delete local folders that are empty.
find . -empty -type d -delete
# Get the HTML page content from urllib import request html = request.urlopen("https://silveiraneto.net").read() # Get the title tag from bs4 import BeautifulSoup title = BeautifulSoup(html, 'html.parser').find('title') print(title.string)
This uses the XML/HTML library BeautifulSoup . This could also be done using regex but playing with HTML and regex is usually a bad idea.
Found on reddit
çççç ççç ççç ççç ççç ççç ççç ççç ççç çççç çç çç
Fiz esse script (cedilha.sh) pra fazer o c-cedilha (ç) funcionar no Ubuntu 16.04. Como é uma tarefa chata que eu já tive que fazer muitas vezes fica mais fácil pra mim ter um script pra fazer isso e pode ser que seja útil a outras pessoas. Infelizmente é uma solução que exige baixar e executar como root um script da internet. Eu recomendo que você leia o script e entenda o que está acontecendo antes de executá-lo. Esse script altera vários arquivos importantes e ele faz um backup (.bak) desses arquivos.
[bash]wget https://raw.githubusercontent.com/silveira/cedilha.sh/master/cedilha.sh
sudo bash cedilha.sh[/bash]
Por favor, se o script funcionou pra você também, diga nos comentários. Se você não está usando Ubuntu 16.04 e quer testar o script ainda assim, edite o script e remova a verificação no inicio do programa.