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
# to store in ./config | |
index: | |
analysis: | |
analyzer: | |
full_text_analyzer: | |
type: custom | |
tokenizer: standard | |
filter: [standard, lowercase, asciifolding] | |
partial_text_analyzer : | |
type : custom |
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
dotcloud run db "mongodump -h APPNAME.dotcloud.com:DBPORT -u root -p PASSWORD -d DBNAME" | |
dotcloud run db -- \ | |
"tar -chf- dump 2>/dev/null | base64 -w0" \ | |
| base64 -d > backup-`date +%s`.tar |
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 loadJS(src, cb) { | |
var inc = document.createElement("script"); | |
inc.onload = inc.onreadystatechange = function() { | |
if (cb && inc.readyState == "loaded" || inc.readyState == "complete" || inc.readyState == 4) | |
cb(); | |
}; | |
inc.src = src; | |
document.getElementsByTagName("head")[0].appendChild(inc); | |
}; |
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 lines = []; | |
var win = document.getElementsByName("FrameWork")[0].contentWindow; | |
var doc = win.document; | |
function nextPage() { | |
//doc.getElementsByClassName("pagination")[0].getElementsByTagName("a") | |
win.location.href = "javascript:suivante()"; | |
} | |
function scrapeLine(tr) { |
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
# You have to restart the core audio be pasting the following line into termnal | |
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` |
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
echo Number of requests per second (read in real-time from appd.out log file) | |
tail -F appd.out | sed -u -n -e '/===/p' | pv -l -i10 -r >/dev/null |
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 colors = require('colors'); | |
function makeColorConsole(fct, color){ | |
return function(){ | |
for (var i in arguments) | |
if (arguments[i] instanceof Object || arguments[i] instanceof Array) | |
arguments[i] = sys.inspect(arguments[i]); | |
fct(Array.prototype.join.call(arguments, " ")[color]); | |
}; | |
} |
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
#!/usr/bin/python | |
""" | |
based on @rochacbruno Python http server version 0.1 (for testing purposes only) | |
Save this file as server.py | |
>>> python server.py 0.0.0.0 8001 | |
serving on 0.0.0.0:8001 | |
or simply |
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
sudo find . "*" -print0 | xargs -0 -I {} basename {} | uniq -d -i >~/dupes.txt |
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 COOKIE_DEF = "showAd=0", COOKIE_EXP = 365 * 24 * 60 * 60 * 1000; // 1 year | |
var display = (document.cookie || "").indexOf(COOKIE_DEF) == -1; | |
var $ad = $("#myAd").toggle(display); | |
$ad.find(".removeAd").click(function() { | |
document.cookie = COOKIE_DEF + "; expires=" + new Date(Date.now() + COOKIE_EXP).toGMTString(); | |
$ad.animate({height:0}, function() { | |
$(this).remove(); | |
}); | |
}); |