Skip to content

Instantly share code, notes, and snippets.

View chrislkeller's full-sized avatar

Chris Keller chrislkeller

View GitHub Profile
@kjam
kjam / twitter_example.html
Created July 21, 2011 15:09
Twitter Search
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.getJSON('http://search.twitter.com/search.json?q=earthquake&lang=en&callback=?', function(data) {
var data = data.results;
var html = "<ul>";
for(var i=0; i<data.length; i++) {
html += "<li><a href='http://twitter.com/" + data[i].from_user + "'>@"
@pithyless
pithyless / gist:1208841
Created September 10, 2011 21:49
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@jkeefe
jkeefe / wnyc.addressbox.js
Created November 2, 2011 05:13
Address Box Code
/////////
//
// Things you need in place to use this:
// - have loaded jquery
// - have called your google map "map" and declared it globally
// such as: var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
// - have <div id="address_module"></div> where you want your address box
// - call addressBoxSetup(); in your $(document).ready(function(){ ... });
//
//
@ryanpitts
ryanpitts / collect_facebook_stats.py
Created December 13, 2011 23:05
This script uses the Facebook API to fetch stats for a given list of URLs. We use it at year's end to compile a "most shared" story list.
"""
One of our editors thought it would be fun to run a year-end list of our
most-shared stories. This script uses the Facebook API to fetch stats for
a given list of URLs.
The script will:
- create a csv file that's named based on the value of TOP_URLS_FILE. This
file logs URLs that have enough shares to surpass your TOP_THRESHHOLD number.
@brianboyer
brianboyer / gist:1696819
Created January 29, 2012 02:21
Lion dev environment notes
@markng
markng / part1.py
Created February 25, 2012 04:34
Web Scraping NICAR Python class
import requests
import csv
from pyquery import PyQuery as pq
f = open('strike_all_bills.csv', 'w')
wr = csv.DictWriter(f, ['billno'])
req = requests.get('http://www.azleg.gov/StrikeEverything.asp')
html = pq(req.text)
rows = html('tr.TableHeaderBackground').siblings()
@crofty
crofty / leaflet-google.js
Created March 25, 2012 15:07
Leaflet plugin that enables the use of Google Map tiles - http://matchingnotes.com/using-google-map-tiles-with-leaflet
/*
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@kjam
kjam / basic_web_page.html
Created June 24, 2012 15:24
Basic Web Page
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
//This is where we will put script later.
</script>
</head>
<body>
<h2>Twitter</h2>
@kjam
kjam / twitter_search_with_map.html
Created June 24, 2012 16:24
Twitter Search With Map
<!DOCTYPE html>
<html>
<head>
<title>Twitter + Google</title>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<style type="text/css">
html, body, #map_canvas {
margin: 0;