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 readline | |
def readBack(length=50): | |
history_items=range(readline.get_current_history_length()+1) | |
this_readback=history_items[-length:] | |
for line in this_readback: | |
print readline.get_history_item(line) |
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
""" | |
Creates a list of URLs to stdout based on repeating patterns found in the site, suitable for use with WGET or CURL. | |
""" | |
import datetime | |
scopes=[ | |
"aries", | |
"taurus", |
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
""" | |
Example of using the old BeautifulSoup API to extract content from downloaded html files into CSV... if you're doing this sort of thing today, I recommend using the newer lxml interface directly, but lxml also has a BeautifulSoup compatibility layer. | |
""" | |
import os | |
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 | |
# WARNING: If you want to use it, don't rely on it, and you'd have to edit it to get to work for you, wherever you are, if you're in the US. | |
from lxml import etree | |
from urllib2 import urlopen | |
from subprocess import Popen, PIPE | |
COUNTY="franklin" | |
#COUNTY="union" |
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-like dir function for Kawa scheme objects (but not the global namespace) | |
(require 'list-lib) | |
(require <kawa.lib.srfi95>) | |
;retrieve class name as string | |
(define classname (lambda (x) (invoke x 'getName))) | |
;make a one-dimensional array into a list | |
(define tolist (lambda (l) (map l (iota l:length)))) |
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
!!ARBfp1.0 | |
TEMP tex, temp; | |
TEX tex, fragment.texcoord[0], texture[0], RECT; | |
DP3 temp.r, tex, {0.01, 0.01, 0.01, 0}; | |
DP3 temp.g, tex, {0.05, 0.05, 0.05, 0}; | |
DP3 temp.b, tex, {0.04, 0.04, 0.04, 0}; | |
MOV temp.a, tex.a; | |
MOV result.color, temp; | |
END |
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 | |
curl -d "{\"jsonrpc\": \"2.0\", \"method\": \"Player.Open\", \"params\":{\"item\": { \"file\" : \"plugin://plugin.video.youtube/?action=play_video&videoid=$@\" }}, \"id\" : 1}" http://xbmc:[email protected]:8080/jsonrpc | |
# curl and everything after it should be on one line. change the port and host to your | |
# liking and your username and password if you've changed it from the default |
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
(defn edges [listing] | |
(loop [accum (list (take 2 listing)) | |
queue (rest listing)] | |
(if (> (count queue) 1) | |
(recur | |
(concat accum | |
(list (take 2 queue))) | |
(rest queue)) | |
accum))) |
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
// Adds a menu option to refresh all options. | |
function onOpen() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var entries = [{ | |
name : "Refresh", | |
functionName : "refreshLastUpdate" | |
}]; | |
sheet.addMenu("Refresh", entries); | |
}; |
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 subprocess, sys | |
from datetime import datetime | |
from time import sleep | |
timestamp = lambda : datetime.now().isoformat() | |
# # pager_rtl.sh -- | |
# rtl_fm -M fm -f 152.48M -r22050 -s88200 -g 42 -l 30 | |
rtl_fm = subprocess.Popen("./pager_rtl.sh", |
OlderNewer