This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function VigenèreAutokeyCipher(key, abc) { | |
this.keyStore = ''; | |
this.encode = function (str) { | |
var box = [abc]; | |
this.keyStore = key; | |
for(var k in str){ | |
this.keyStore += abc.indexOf(str[k]) < 0 ? '' : str[k]; | |
} | |
for(var i in abc){ | |
box.push(abc.split(abc[i])[1] + abc.split(abc[i])[0] + abc[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Cromossomo = function(genes){ | |
if(genes) | |
this.genes = genes; | |
this.custo = 10000; | |
}; | |
Cromossomo.prototype.genes = ''; | |
Cromossomo.prototype.random = function(tamanho){ | |
this.genes = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MORSE_CODE = {'\.-' : 'A', '-\.\.\.' : 'B', '-\.-\.' : 'C', '-\.\.' : 'D', '\.' : 'E', '\.\.-\.' : 'F', '--\.' : 'G', '\.\.\.\.' : 'H', '\.\.' : 'I', '\.---' : 'J', '-\.-' : 'K', '\.-\.\.' : 'L', '--' : 'M', '-\.' : 'N', '---' : 'O', '\.--\.' : 'P', '--\.-' : 'Q', '\.-\.' : 'R', '\.\.\.' : 'S', '-' : 'T', '\.\.-' : 'U', '\.\.\.-' : 'V', '\.--' : 'W', '-\.\.-' : 'X', '-\.--' : 'Y', '--\.\.' : 'Z', '\.-\.-' : 'Ä', '\.--\.-' : 'Á', '\.--\.-' : 'Å', '\.\.-\.\.' : 'É', '--\.--' : 'Ñ', '---\.' : 'Ö', '\.\.--' : 'Ü', '-----' : '0', '\.----' : '1', '\.\.---' : '2', '\.\.\.--' : '3', '\.\.\.\.-' : '4', '\.\.\.\.\.' : '5', '-\.\.\.\.' : '6', '--\.\.\.' : '7', '---\.\.' : '8', '----\.' : '9', } | |
var decodeBits = function(bits){ | |
var morse = [], bits = bits.split(''), last = '', trecho = '', frequency = {}; | |
for (var i = bits.length - 1; i >= 0; i--) { | |
if(last.length > 0 && last != bits[i]){ | |
var obj = frequency[last] ? frequency[last] : {}; | |
obj[trecho.length] = trecho | |
frequency[last] = obj; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Necessário ter python, apache e banco instalados | |
#Depois é preciso baixar pip | |
#Instalar o pip | |
wget https://bootstrap.pypa.io/get-pip.py | |
pyhton get-pip.py | |
sudo pip install Django | |
sudo pip install MySQL-python | |
sudo pip install django-input-mask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((`pgrep pavucontrol` > 0)); then echo 'ja existe'; else pavucontrol; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du -a /var | sort -n -r | head -n 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$client = new SoapClient('http://www.dominio.com.br/api/v2_soap/?wsdl'); | |
$session = $client->login('usuario', '123456789senha'); | |
$result = $client->salesOrderInfo($session, '123132131'); | |
var_dump($result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
if [[ "$1" == "-h" || "$1" == "-help" ]]; then | |
echo "Script de deploy"; | |
echo "./deploy [dir] [branch]"; | |
exit; | |
fi | |
if [[ "$1" == "-b" ]]; then | |
echo "Branch atuais:"; | |
for D in `ls -d $2*/` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#awesome command | |
( zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | egrep '^(Start-Date:|Commandline:)' | grep -v aptdaemon | egrep '^Commandline:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer