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
DROP PROCEDURE duplicate_customer; | |
DELIMITER $$ | |
CREATE PROCEDURE duplicate_customer(IN old_entity_id INT, IN new_email VARCHAR(250)) | |
BEGIN | |
DECLARE cursorlist_done BOOLEAN DEFAULT FALSE; | |
DECLARE old_address_entity_id INT; | |
DECLARE old_entity_type_id smallint(5); | |
DECLARE old_attribute_set_id smallint(5); |
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
ls -la |
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 |
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
#/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
$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
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
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
#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
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; |
NewerOlder