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
/** | |
* Do you use TweetDeck to manage multiple twitter accounts ? | |
* | |
* Do you want a simple tool to ONLY show columns for 1 specific account, and hide other columns ? | |
* | |
* This bookmarklet, will replace items in left side bar with account buttons. When you click on one of these buttons, | |
* only the columns for this account will be shown. | |
* | |
* Keep in mind that if TweetDeck update their code, this bookmark will probably brake, but atm it works great ! | |
*/ |
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
/** | |
* Turns a json object with snipet content into a simple link that let you | |
* edit the snippet in the html5snippet.net editor. | |
* | |
* This is useful if you host js/css/html5 snippets in your tutorials and want | |
* users to be able to play with it without leaving the browser, and without | |
* saving snippets at html5snippet.net server. | |
* | |
* To use this function, simply copy-paste it in your project. It's standalone. | |
* |
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 getRandomColor = function() { | |
return { | |
r: Math.floor(Math.random()*255), | |
g: Math.floor(Math.random()*255), | |
b: Math.floor(Math.random()*255), | |
a: parseFloat(Math.random().toFixed(2)) | |
} | |
}; | |
var getRandomColorString = function(alpha) { |
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
read -s -p "Enter password: " password && echo $password |
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
# Build | |
IMAGEID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1) && sudo docker build -t $IMAGEID . | |
# Run new container | |
CONTAINER_ID=$(sudo docker run -t -d -p 0.0.0.0:81:80 $IMAGEID) | |
# Login into running containe. REQUIRES DOCKER >= 1.3 | |
sudo docker exec -it $CONTAINER_ID bash | |
# !!! DEPRECATED !!! Login into running container. REQUIRES DOCKER < 0.9 |
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 replaceVarsUnsafe = function(vars, str, sep) { | |
sep = sep||'%'; | |
for (var i in vars) str = str.replace(new RegExp('('+sep+i+sep+')+', 'g'), vars[i]); | |
return str; | |
}; | |
var s = "/home/%user%/somedir/%dir1%/foo/%dir2%/%dir1%/file.%ext%"; | |
r = replaceVarsUnsafe({ | |
user: "alice", |
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/sh | |
echo "installing scapy" | |
sudo apt-get install tcpdump python-scapy -y | |
echo "installing aircrack ng" | |
cd ~ && rm -rf aircrack && mkdir -p aircrack && cd aircrack | |
sudo apt-get install libnl1 libnl-dev libssl-dev subversion -y | |
svn co http://svn.aircrack-ng.org/trunk && cd trunk | |
make |
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
// Tip #1 | |
// | |
// Symptom: environment hell | |
// Here is how i handle environments | |
// In bootstrap/start.php, replace "$env = $app->detectEnvironment(..." by this: | |
$env = $app->detectEnvironment(function(){ | |
$SERVER_ENV = strtolower(strval(isset($_SERVER["ENV"])?$_SERVER["ENV"]:'')); | |
$DOCKER_ENV = strtolower(strval(getenv("ENV"))); |
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 | |
python -m smtpd -n -c DebuggingServer localhost:25 |
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
1/ Resize to X width, keep aspect ratio | |
#!/bin/bash | |
mogrify -resize 2000x *.jpg | |
2/ Resize to Y height, keep aspect ratio |
OlderNewer