Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
<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 + "'>@" |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
///////// | |
// | |
// 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(){ ... }); | |
// | |
// |
""" | |
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. |
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() |
/* | |
* 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, |
#!/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 | |
# |
<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> |
<!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; |