Skip to content

Instantly share code, notes, and snippets.

Chris Gemignani chrisgemignani

Block or report user

Report or block chrisgemignani

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chrisgemignani
chrisgemignani / basic-raphael-map.html
Created Jul 14, 2011
Simple Raphael Maps using D3 Projections
View basic-raphael-map.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Simple Raphael Maps Using D3 Projections</title>
<script type="text/javascript" charset="utf-8" src="raphael-min.js"></script>
<script type="text/javascript" charset="utf-8" src="geo-projection.js"></script>
<script type="text/javascript" charset="utf-8" src="us.svg.js"></script>
View gist:87867
"""
Fetch people for Twitalyzer's mechanical turk. Will fetch and submit
Twitalyzer turk people forever with DELAY seconds between each pull.
Hit Ctrl-C (OSX, Linux) or Ctrl-D (Windows) to stop.
To use, just run:
> python twitalizer_turk.py
View Left Right CSS
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<!-- an example of how to do two divs side by side -->
<style type="text/css" media="screen">
View gist:52843
' Add this to the page that contains the master PivotTable
' assumes the page containing the slave PivotTables is named "Transform"
'
'
' On PivotTable update in the Display page
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim masterPf As PivotField
Dim slavePf As PivotField
Dim pt As PivotTable
View gist:47051
size(520, 500)
from math import pi
data = [
#Pattern,expedia.com,hotel-guides.us,travel.yahoo.com,travelocity.com,tripadvisor.com
['[x] hotel',0.02154,0.00903,0.35186,0.16603,0.45155],
['[x] hotel [x]',0.00000,0.00000,0.14872,0.26750,0.58378],
['[x] inn [x]',0.03185,0.00000,0.00000,0.24957,0.71859],
['hotel [x]',0.01385,0.02769,0.31154,0.23692,0.41000],
['hotel in [x]',0.03216,0.00000,0.53631,0.19191,0.23963],
View gist:47043
size(520, 500)
from math import pi
data = [
#Pattern,expedia.com,hotel-guides.us,travel.yahoo.com,travelocity.com,tripadvisor.com
['[x] hotel',0.02154,0.00903,0.35186,0.16603,0.45155],
['[x] hotel [x]',0.00000,0.00000,0.14872,0.26750,0.58378],
['[x] inn [x]',0.03185,0.00000,0.00000,0.24957,0.71859],
['hotel [x]',0.01385,0.02769,0.31154,0.23692,0.41000],
['hotel in [x]',0.03216,0.00000,0.53631,0.19191,0.23963],
View gist:47037
size(520, 620)
from math import pi
data = [
#Pattern,expedia.com,hotel-guides.us,travel.yahoo.com,travelocity.com,tripadvisor.com
['[x] hotel',0.02154,0.00903,0.35186,0.16603,0.45155],
['[x] hotel [x]',0.00000,0.00000,0.14872,0.26750,0.58378],
['[x] inn [x]',0.03185,0.00000,0.00000,0.24957,0.71859],
['hotel [x]',0.01385,0.02769,0.31154,0.23692,0.41000],
['hotel in [x]',0.03216,0.00000,0.53631,0.19191,0.23963],
View gist:47036
size(520, 620)
from math import pi
data = [
#Pattern,expedia.com,hotel-guides.us,travel.yahoo.com,travelocity.com,tripadvisor.com
['[x] hotel',0.02154,0.00903,0.35186,0.16603,0.45155],
['[x] hotel [x]',0.00000,0.00000,0.14872,0.26750,0.58378],
['[x] inn [x]',0.03185,0.00000,0.00000,0.24957,0.71859],
['hotel [x]',0.01385,0.02769,0.31154,0.23692,0.41000],
['hotel in [x]',0.03216,0.00000,0.53631,0.19191,0.23963],
View gist:47013
size(520, 620)
from math import pi
data = [
#Pattern,expedia.com,hotel-guides.us,travel.yahoo.com,travelocity.com,tripadvisor.com
['[x] hotel',0.02154,0.00903,0.35186,0.16603,0.45155],
['[x] hotel [x]',0.00000,0.00000,0.14872,0.26750,0.58378],
['[x] inn [x]',0.03185,0.00000,0.00000,0.24957,0.71859],
['hotel [x]',0.01385,0.02769,0.31154,0.23692,0.41000],
['hotel in [x]',0.03216,0.00000,0.53631,0.19191,0.23963],
View gist:39174
"""
Reduce the size of the store fixture by removing adminareas
"""
from django.config.serializers import yaml
store = yaml.load(open("store.yaml"))
small_store = [itm for itm in store
if not itm['model'] == 'l10n.adminarea' or
(itm['model'] == 'l10n.adminarea' and itm['fields']['country'] == 231)]
s = yaml.dump(small_store)
You can’t perform that action at this time.