Skip to content

Instantly share code, notes, and snippets.

View voidfiles's full-sized avatar

Alex Kessinger voidfiles

View GitHub Profile
@voidfiles
voidfiles / gist:1394631
Created November 25, 2011 23:09
Flickr actionQueue fav handler
F.actionQueue.register('button-bar-fave', {
interim: function(id) {
var fave_button = document.getElementById(id);
if (fave_button.className.search(/fave/) === -1) {
fave_button.className = 'Butt ywa-track fave-button fave';
} else {
fave_button.className = 'Butt ywa-track fave-button';
}
},
cleanup: function(id) {
@voidfiles
voidfiles / flickr_action_queue.js
Created November 25, 2011 22:43
Flickrs actionQueue code isolated
(function(F) {
var registered_ids = {},
id_to_module_map = {},
interim_actions = {},
cleanup_actions = {},
clicked_ids = {},
queueing = true;
function register_id(id, callbacks, required_module) {
id = id.replace('*', '.*');
@voidfiles
voidfiles / gist:1390075
Created November 23, 2011 22:10
Flickr's Pre-script loading event handler code
(function(F) {
var registered_ids = {},
id_to_module_map = {},
interim_actions = {},
cleanup_actions = {},
clicked_ids = {},
queueing = true;
function register_id(id, callbacks, required_module) {
id = id.replace('*', '.*');
@voidfiles
voidfiles / gist:1046748
Created June 25, 2011 18:33
Parsing Extractiv JSON Crawl Job Output
"""
Extractive is a cool new service that does some on the fly web
crawling, and machine learning stuff like Entity Extraction, Full
text extraction, and more things I don't even understand. There
on demand api was very easy to use, but I built my first crawl
job the other night, and had some trouble parsing the results.
I thought I would put this up so people can see how I fixed the
output.
"""
@voidfiles
voidfiles / join_text_url.py
Created February 15, 2011 07:09
Joins a piece of text with a url to form max length tweet
long_tweet = 'asdfasdf asd fasd fasdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdfasdf asdfasdfas dfasd fasd fasdf asdf asdf asdf asdf asdf asdf '
short_tweet = 'asdfasdf asd fasd fasdf asdf asdf asdf asdf asdf asdf asdf asdf'
url = "http://sia.tw/4fgs4"
def join_url(tweet, url):
max_tweet_length = 139
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" securityLevel="any">
<meta>
<author>Picplz</author>
<documentationURL>http://picplz.com</documentationURL>
<sampleQuery>select * from {table} WHERE entity='feed' AND type='interesting'</sampleQuery>
<sampleQuery>select * from {table} WHERE entity='city' AND id=2 AND include_pics=1</sampleQuery>
<sampleQuery>select * from {table} WHERE entity='user' AND username='zubillaga' AND include_pics=1;</sampleQuery>
</meta>
<bindings>
{
"result": "ok",
"value": {
"more_pics": true,
"last_pic_id": 153217,
"pic_count": 200,
"pics": [
{
"city": {
"url": "/city/san-francisco-ca/",
{
'cannonical_link': 'http://www.livemixtapes.com/mixtapes/2184/gang_related.html',
'dj': {
'link': 'http://livemixtapes.com/djs/404/dj_messiah.html',
'name': 'DJ Messiah'
},
'img_url': 'http://images.livemixtapes.com/artists/messiah/gangrelated-5star/tn_cover.jpg',
'score': {
'value': '127',
'views': '31,076',
(function(){
var cvp = $.cookie("picplz_viewpref"),
nvp = (cvp===null) ?
"mobile" :
(cvp==="web") ?
"mobile" :
"web";
$.cookie("picplz_viewpref",nvp, {"path": "/"});
})()
require 'formula'
<<-COMMENTS
This is the Homebrew formula for Python.
Versions
--------
This formula is currently tracking version 2.6.x.