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 script = document.createElement('script'); | |
script.src = 'http://code.jquery.com/jquery-1.10.1.min.js'; | |
script.type = 'text/javascript'; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
text = '' | |
$('a[href$=".pdf"]').each(function() {text = text + this.href + '\n'}) | |
$('body').append('<textarea style="position:absolute;right:0px;top:5%;width:40%;height:10%;" onclick="this.focus();this.select()">' + text + '</textarea>') |
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 | |
level=$1 | |
i=0 | |
while true; | |
do | |
l_value=$(rec -n stat trim 0 .5 2>&1 | awk '/^RMS amplitude/ { printf $3 }';) | |
is_loud=$(echo $l_value | awk -v lev="$level" '{ if ($0 >= lev) printf "1"; else printf "0" }') |
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
from pyquery import PyQuery as pq | |
import sys, os, re, unicodedata | |
def slugify(value): | |
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii') | |
value = re.sub('[^\w\s-]', '', value).strip().lower() | |
return re.sub('[-\s]+', '-', value) | |
url = u'http://www.flickr.com/photos/' |
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 "<ul>" > chars.html | |
for i in {0..65536} | |
do | |
echo "<li>&#$i; = &#$i;<li>" >> chars.html | |
done | |
echo "</ul>" >> chars.html |
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
url="http://www.google.com" | |
if [ ! -e tmp ]; then | |
curl --silent "$url" > tmp | |
fi | |
for i in {0..259200} | |
do | |
curl --silent "$url" | diff tmp - | |
if [ $? -ne 0 ]; then | |
echo "It Changes!" | |
curl --silent "$url" > tmp |
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
import sys | |
content = open(sys.argv[1], 'r').read() | |
for k,v in map(lambda kv:kv.split("="),sys.argv[2:]): | |
content = content.replace('$$%s$$' % k, '%s' % v) | |
print(content) |
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
for i in *.svg; inkscape -A $(echo $(basename -s .svg $i).pdf) $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
python -c "import sys;import os;import time;map(lambda x:os.system('clear;' + ' '.join(sys.argv[1:]))==time.sleep(1), xrange(0,99999999))" date |
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
import time | |
class T(object): | |
def __init__(self): | |
self.now = time.time() | |
def end(self): | |
print(time.time() - self.now) |
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 [ -z "${TIMES}" ]; | |
then | |
echo "TIMES is unset, use export TIMES=10"; | |
TIMES=10 | |
else | |
echo "TIMES is set to $TIMES"; | |
fi |