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 | |
#modified version of old import.py | |
# Lastscrape -- recovers data from libre.fm | |
# Copyright (C) 2009 Free Software Foundation, Inc | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
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
#Extract of R code | |
#This doesn't work properly | |
#Need to know how many levels | |
nl <- length(levels(datatable$Grouping)) | |
#then how many per graph | |
ng = 8 | |
#Can then loop | |
for (i in 1:ceiling(nl/ng)) { |
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
%Reference for pgfSweave / Tikz option | |
%Sweave file extract | |
\begin{figure} | |
<<fig=TRUE, tikz=T>>= | |
print( | |
xyplot(Y ~ Date | Grouping, datatable[levels(datatable$Grouping)[1:8]], layout=c(1,8), ylim=c(-100,100), xlim=as.Date(c("2011-01-01", "2011-07-01")) ) | |
) | |
@ | |
\end{figure} |
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
duplicates.step2$days.between <- sapply( | |
1:nrow(duplicates.step2), | |
function(q) { | |
step2id <- as.character(duplicates.step2.dt[,id][q]) #as.character is important bit! | |
temp <- min( | |
difftime( | |
duplicates.step2.dt[, Date][q], | |
step1.dt[step2id]$Date, #No need to crazily create another data.table | |
units=c("days") | |
) |
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
"IP Address specific | |
"------------------- | |
"(i.e. Home or Work) | |
if ip == -1 | |
"Set proxies, Python urllib2 (TwitVim, Simplenote.vim) will automatically pick | |
"these up | |
let $http_proxy = 'http://<username>:<password>@<proxy-url>:<proxy-port>' | |
let $https_proxy = 'http://<username>:<password>@<proxy-url>:<proxy-port>' | |
endif |
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 | |
import urllib2 | |
import base64 | |
import json | |
snuser = "" | |
snpassword = "" | |
proxyurl = "<proxy url>:<proxy port>" | |
proxylogin = "<proxy username>:<proxy 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
#Bookmarklet to generate QIF for Recent Item and Previous Statement pages on SMILE.co.uk bank | |
#Will (try to) open a new popup window where you will have to either: | |
#a) Copy text from and paste to text editor (Chrome) | |
#b) Save the page as a text file (Firefox) | |
# | |
#Written in Coffescript, but just use http://javascriptcompressor.com/ to compress the | |
#compiled javascript so you have a bookmarklet. | |
data = document.getElementsByClassName("summaryTable")[0].children[1].children |
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
/* | |
Bookmark bar icons, used on OSX and Windows XP | |
Because I do not understand why Firefox tries to emulate Safari on OSX. | |
I want the exact opposite: Icons and no text. | |
This also fixes the default circular hover. | |
*/ | |
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); | |
#personal-bookmarks toolbarbutton { | |
/*This for Windows*/ |
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
--Camino Pinboard save tabs | |
-- An Applescript to Save Open Tabs to Pinboard, using the Save Tabs functionality: | |
-- http://blog.pinboard.in/2011/04/new_save_tabs_feature/ | |
-- Uses francois2metz fake html5-FormData since Gecko 1.9 doesn't have this | |
-- https://github.com/francois2metz/html5-formdata | |
-- BUT DOESN'T BLOODY WELL WORK BECAUSE OF A RESTRICTION IN GECKO 1.9 | |
-- Gecko 1.9 preflights all requests except from text/plain which screws the whole thing up | |
-- (https://developer.mozilla.org/en/http_access_control#Preflighted_requests) | |
-- Oh well, it was a nice idea. |
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
# Pinboard to Camino | |
# | |
# A Ruby script to import/update Pinboard bookmarks into Camino | |
# This is a evolution of this Applescript: https://gist.github.com/835932 which simply deleted and | |
# replaced a bookmarks collection. This Ruby script attempts to update, rather than delete and replace, | |
# so Camino bookmark visit counts are preserved, etc. | |
# | |
# IT IS VERY SLOW! | |
# | |
# Really, it is. Took about 35 mins to run through a Camino bookmarks file with 2003 existing "pinboard" |