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(b) { | |
var a = b.createElement("a"); | |
var s = b.createElement("span"); | |
s.innerText = "Download"; | |
a.appendChild(s); | |
a.href="http://media.soundcloud.com/stream/"+b.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1]; | |
a.setAttribute("class", "pl-button"); | |
a.setAttribute("style", "background-image: url(http://soundcloud.com/images/icons_mini.png?unicorn26); background-repeat: no-repeat; padding-left: 18px; background-position: -77px -236px;"); | |
a.download = b.querySelector("em").innerText+".mp3"; | |
b.querySelector(".primary").appendChild(a); |
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
// Written by Nick Gammon | |
// February 2011 | |
/** | |
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ). | |
* This script will capture the SPI bytes, when a '\n' is recieved it will then output | |
* the captured byte stream via the serial. | |
*/ | |
#include <SPI.h> |
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
// Written by Nick Gammon | |
// February 2011 | |
/** | |
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ). | |
* This script will capture the SPI bytes, when a '\n' is recieved it will then output | |
* the captured byte stream via the serial. | |
*/ | |
#include <SPI.h> |
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 | |
import os | |
def shellquote(s): | |
return "'" + s.replace("'", "'\\''") + "'" | |
files = sorted(os.listdir("./")) | |
shellstring = "" |
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 | |
pdftk "$1" cat 1-endE output rtnup-1.pdf | |
pdfjam --outfile rtnup-2.pdf --nup 2x1 --landscape rtnup-1.pdf | |
pdftk rtnup-2.pdf cat 1-endW output rtnupped.pdf |
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 | |
# | |
# Get current swap usage for running processes | |
# Original: Erik Ljungstrom 27/05/2011 | |
# Modifications by ariel: | |
# - Sort by swap usage | |
# - Auto run as root if not root | |
# - ~2x speedup by using procfs directly instead of ps | |
# - include full command line in output | |
# - make output more concise/clearer |
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 urllib, os | |
# if you comment out this line, it will download to the directory from which you run the script. | |
os.chdir('/tmp/test') | |
url = 'http://www.mydomain.com/myfile.txt' | |
urllib.urlretrieve(url) |
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
.:::::, | |
:::::::` | |
,:::::::: | |
:::::::::. | |
::::::::::: | |
`. ; ,;, '''''',:::::::::: | |
;@. '@ :@@@@@` ;''''''::::::::::` | |
;@. :@@ @@;:#@@ `''''''''.:::::::, | |
;@. .@@@ + #@; ''''''''';::::::: | |
;@. @@@@ :@+ ,''''''''''.,,,,,` |
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
gent_running() { | |
[ "$SSH_AUTH_SOCK" ] && { ssh-add -l >/dev/null 2>&1 || [ $? -eq 1 ]; } | |
} | |
env=~/.ssh/agent.env | |
if ! agent_running && [ -s "$env" ]; then | |
. "$env" >/dev/null | |
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
# | |
# templatetags/kwacros.py - Support for macros in Django templates | |
# | |
# Based on snippet by | |
# Author: Michal Ludvig <[email protected]> | |
# http://www.logix.cz/michal | |
# | |
# modified for args and kwargs by Skylar Saveland http://skyl.org | |
# |
OlderNewer