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
CmdUtils.CreateCommand({ | |
names: ["isgd"], | |
author: {name: "Thomas Brownback", homepage: "http://thomasbrownback.com", blog: "http://theorybloc.com"}, | |
contributors: ["Tom Parker"], | |
thanks: {first: "Aza Raskin", foremost: "Aza Raskin", honorableMention: "geero.net", lastAmpBangLeast: "users like you"}, | |
license: "PUBLIC DOMAIN: Any and all rights herein are hereby donated to the commons.", | |
description: "Shortens a URL using is.gd.", | |
help: "Replaces a selection with (or simply inserts) a shortened URL from is.gd.", | |
arguments: [{role: "urlToShorten", | |
nountype: noun_arb_text, |
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
// ==UserScript== | |
// @name Remove left blank in Google results | |
// @namespace http://tevp.net/projects/ | |
// @description Remove left blank in Google results | |
// @include http://www.google.*/search* | |
// ==/UserScript== | |
function xpath(query) { | |
return document.evaluate(query, document, null, | |
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, 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
artist(Name) -> | |
lastfm_call(artist.search, [{artist,Name}], ['artistmatches'], ['artist'], []). | |
album(Name) -> | |
lastfm_call(album.search, [{album,Name}], ['albummatches'], ['album'], ['artist']). | |
track(Name) -> | |
lastfm_call(track.search, [{track,Name}], ['trackmatches'], ['track'], ['artist','listeners']). |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<kml xmlns="http://www.opengis.net/kml/2.2"> | |
<Document> | |
<Placemark> | |
<name>Test item one</name> | |
<Point> | |
<coordinates>-0.000180,-0.000180</coordinates> | |
</Point> | |
</Placemark> | |
<Placemark> |
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
<DocumentElement> | |
<Table> | |
<Id>657</Id> | |
<WLo>0.11070013046264648</WLo> | |
<WLa>51.493020732623478</WLa> | |
<GZ>15</GZ> | |
<LN>Abbey Wd - Felixstowe Rd</LN> | |
</Table> | |
<Table> | |
<Id>139</Id> |
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
@RunWith(RobolectricTestRunner.class) | |
public class MyActivityTest { | |
private Activity activity; | |
private Button pressMeButton; | |
private TextView results; | |
@Before | |
public void setUp() throws Exception { | |
activity = new MyActivity(); | |
activity.onCreate(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
try: | |
from mercurial import ui, hg, revset | |
except ImportError: | |
raise Exception, "Need mercurial >=1.6 for revset!" | |
def revs(repo, spec, items = None): | |
ret = [] | |
if items == None: | |
items = range(len(repo)) | |
m = revset.match(spec) |
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
# get all the open heads | |
heads = revs(repo, "head() & (! closed())") | |
# find the common ancestor of default and revision_number ... | |
ancestor = revs(repo, "ancestor(%d, default)"% revision_number )[0] | |
# ... then get the path of changes between the common ancestor | |
# and our original revision | |
path = revs(repo, "%d::%d"%(ancestor, revision_number)) | |
# The above can also be done just as |
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 gzip | |
from re import compile | |
from os.path import exists | |
from sys import exit, argv | |
from xml.dom.minidom import parseString | |
import codecs | |
try: | |
import urlgrab | |
except ImportError: | |
print "run 'git clone git://github.com/palfrey/urlgrab.git' and re-run this script" |
OlderNewer