Skip to content

Instantly share code, notes, and snippets.

View armoucar's full-sized avatar

Arthur Moura Carvalho armoucar

  • Brasília, DF - Brasil
View GitHub Profile
@armoucar
armoucar / keybindings.json
Created October 19, 2019 15:09
VSCode Shortcuts
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+alt+cmd+down",
"command": "scrollPageDown",
"when": "editorTextFocus"
},
{
"key": "cmd+pagedown",
"command": "-scrollPageDown",
@armoucar
armoucar / heimdall
Created July 8, 2017 01:42
Heimdall android flash firmware - Samsung Galaxy S i9000
# Commands are executed with your phone in download mode
$ heimdall detect
$ heimdall print-pit
$ heimdall download-pit --output mypit.pit --verbose --stdout-errors --usb-log-level debug --no-reboot
# Dentro de uma pasta
# CSC_XENJV5.tar & PDA_XWJW1_Sbl.tar & PHONE_XXJVT.tar extraídos
arthur ~/xxjvt
# Solução rápida.
(1..100).each do |counter|
nama_team = "#{'Nama' if counter % 5 == 0 } #{'Team' if counter % 7 == 0 }".strip
nama_team = counter if nama_team.empty?
puts nama_team
end
# Solução mais elegante
# Explicação: caso um novo multiplo precise ser adicionado, tanto para 'Nama' quanto para 'Team',
# será necessário apenas adicionar o novo multiplo ao Array correspondente.
@armoucar
armoucar / beatiful_lines.sh
Last active December 11, 2015 14:21
Beautiful command line to organize pictures.
exiftool '-FileName<DateTimeOriginal' -d "%Y-%m-%d %H.%M.%S%%-c.%%e" dir/*.jpg # jpg
exiftool '-FileName<CreateDate' -d "%Y-%m-%d %H.%M.%S%%-c.%%e" ./*.mp4 # mp4
for f in *; do mv "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done #rename files to lowercase
youtube-dl https://www.youtube.com/playlist?list=ListID --output './%(autonumber)s-%(title)s.%(ext)s'
# Download all images from a page
wget http://whatever.com/ -p -A .jpg,.jpeg,.png -H -nd
CDS pra pegar depois.
http://pt.wikipedia.org/wiki/Anexo:Lista_dos_100_maiores_discos_da_m%C3%BAsica_brasileira_pela_Rolling_Stone_Brasil
http://pt.wikipedia.org/wiki/L%C3%B3ki%3F
http://pt.wikipedia.org/wiki/Arnaldo_Baptista
https://pt.wikipedia.org/wiki/Tropicalia_ou_Panis_et_Circencis
CDS pra pegar depois.
http://pt.wikipedia.org/wiki/Anexo:Lista_dos_100_maiores_discos_da_m%C3%BAsica_brasileira_pela_Rolling_Stone_Brasil
http://pt.wikipedia.org/wiki/L%C3%B3ki%3F
http://pt.wikipedia.org/wiki/Arnaldo_Baptista
@armoucar
armoucar / gist:5210520
Created March 21, 2013 03:41
javascript red to green
var arr = [], hexa;
for (i = 0; i < 255; i += 51) {
hexa = "#ff" + Number(i).toString(16) + "00";
console.log(hexa);
arr.push(hexa);
}
for (i = 255; i > 0; i -= 51) {
hexa = "#" + Number(i).toString(16) + "ff00";
console.log(hexa);
@armoucar
armoucar / CalculandoGridFlexivel.java
Last active December 11, 2015 17:49
Gera css para grid flexivel
public class CalculandoGridFlexivel {
public static final DecimalFormat df = new DecimalFormat("#.####");
public static void main(String[] args) {
float width = 1080;
float espacamento = 10;
float qtdTotaisDeColunas = 8;
float tamanhoDaMenorColuna = (width / qtdTotaisDeColunas) - (espacamento * 2);
@armoucar
armoucar / StringEncoding.java
Last active December 10, 2015 21:58
java string charset parser
new String("abc".getBytes(Charset.forName("ISO-8859-1")), Charset.forName("UTF-8"));
@armoucar
armoucar / git.txt
Created January 9, 2013 23:54
comandos git
Instalação do GIT no ubuntu:
sudo apt-get install git-core git-svn ssh gitk
ssh-keygen -t rsa
git config --global user.name "Arthur Moura Carvalho"
git config --global user.email "armoucar@gmail.com"
git config --global color.status "auto"
git config --global color.branch "auto"
git config --global color.interactive "auto"
git config --global color.diff "auto"