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
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold | |
old = red bold |
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/env ruby -wKU | |
require 'net/http' | |
require 'uri' | |
### SEE http://www.kloonigames.com/blog/games/4mins33secs | |
STDOUT.sync = true; token = rand(28000); time = 0 | |
uri_root = "http://www.kloonigames.com/nordicjam2009/" | |
start = URI.parse(uri_root + "new_game.php?v=#{token}"); | |
whois = URI.parse(uri_root + "whois.txt"); |
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
#!/opt/local/bin/perl -w | |
# Scrapes the AirBears logon page for interesting variables and authenticates | |
# you with a given SID and password. Should work with minor modifications | |
# for other Vernier based systems. | |
# | |
# Licensed under the WTFPL, see http://sam.zoy.org/wtfpl/ | |
# | |
# (C) 2006 Joshua Kwan <[email protected]> | |
use HTTP::Cookies; |
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 web | |
import httplib | |
urls = ("/(.+?)/?", "http_err") | |
app = web.application(urls, globals()) | |
class http_err: | |
def GET(self, err_code): | |
err_code = int(err_code.split("/")[0]) | |
response = "%d %s" % (err_code, httplib.responses[err_code]) |
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; reload(sys); sys.setdefaultencoding('utf-8') | |
import MySQLdb | |
import urllib2 | |
import urllib | |
import simplejson | |
login = 'your github login' | |
token = 'your github API key' | |
repo = 'username/repo' |
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
protected String[] doInBackground(String... credentials) { | |
String consumer_secret = mActivity.getString(R.string.oauth_consumer_secret); | |
HttpClient client = new DefaultHttpClient(); | |
HttpPost request = new HttpPost("https://www.instapaper.com/api/1/oauth/access_token"); | |
CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(mActivity.getString(R.string.oauth_consumer_key), | |
consumer_secret); | |
List<BasicNameValuePair> params = Arrays.asList( | |
new BasicNameValuePair("x_auth_username", credentials[0]), | |
new BasicNameValuePair("x_auth_password", credentials[1]), | |
new BasicNameValuePair("x_auth_mode", "client_auth")); |
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
{ | |
"do_json": true, | |
"package": "com.yelp.parcelgen", | |
"props": { | |
"String": [ | |
"id", "name", "imageUrl", "url", "mobileUrl", | |
"phone", "displayPhone", "ratingImageUrl", | |
"ratingImageUrlSmall", "snippetText", "snippetImageUrl" | |
], | |
"int": ["reviewCount"], |
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
int contentLength = 0; | |
if (request.containsHeader("content-length")) { | |
contentLength = Integer.parseInt(request.getFirstHeader("content-length").getValue()); | |
} | |
String bodyString = null; | |
if (contentLength > 0) { | |
BasicHttpEntityEnclosingRequest req = new BasicHttpEntityEnclosingRequest(request.getRequestLine()); | |
try { | |
conn.receiveRequestEntity(req); |
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 re, htmlentitydefs, os.path, urllib | |
## | |
# Removes HTML or XML character references and entities from a text string. | |
# Thank you Fredrik Lundh | |
# http://effbot.org/zone/re-sub.htm#unescape-html | |
# | |
# @param text The HTML (or XML) source text. | |
# @return The plain text, as a Unicode string, if necessary. |
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
2011-10-26 16:04:05.344 JSONPerfTest[27924:10103] SBJSON-twitter_public.json 0.371 | |
2011-10-26 16:04:05.605 JSONPerfTest[27924:10103] YAJL-twitter_public.json 0.259 | |
2011-10-26 16:04:06.076 JSONPerfTest[27924:10103] TouchJSON-twitter_public.json 0.470 | |
2011-10-26 16:04:06.190 JSONPerfTest[27924:10103] JSONKit-twitter_public.json 0.113 | |
2011-10-26 16:04:06.327 JSONPerfTest[27924:10103] NextiveJson-twitter_public.json 0.135 | |
2011-10-26 16:04:06.434 JSONPerfTest[27924:10103] NSJSONSerialization-twitter_public.json 0.106 | |
2011-10-26 16:04:07.093 JSONPerfTest[27924:10103] SBJSON-lastfm.json 0.656 | |
2011-10-26 16:04:07.447 JSONPerfTest[27924:10103] YAJL-lastfm.json 0.354 | |
2011-10-26 16:04:08.275 JSONPerfTest[27924:10103] TouchJSON-lastfm.json 0.827 | |
2011-10-26 16:04:08.444 JSONPerfTest[27924:10103] JSONKit-lastfm.json 0.168 |
OlderNewer