Skip to content

Instantly share code, notes, and snippets.

View blech's full-sized avatar

Paul Mison blech

View GitHub Profile
@blech
blech / README.md
Last active September 24, 2015 10:38
iTunes defaults

These four defaults settings will disable Ping, hide the dropdown, restore the old arrows, and invert them such that clicking them will navigate the libary, not the Store. Boiled down from http://gidden.net/tom/2010/09/25/removing-ping

defaults write com.apple.iTunes disablePingSidebar 1
defaults write com.apple.iTunes hide-ping-dropdown 1
defaults write com.apple.iTunes show-store-link-arrows 1

defaults write com.apple.iTunes invertStoreLinks 1

@ewilderj
ewilderj / friends.py
Created December 9, 2010 18:19
Make a graph of your social network from those you follow
# a messy hack written by Edd Dumbill. http://twitter.com/edd
# You may need to rerun this script if you hit a Twitter Error because you
# use up API rate limiting. That's why we pickle the results, so we can resume
# where we left off.
# get the twitter module using 'easy_install twitter'
from twitter.api import Twitter, TwitterError
from twitter.oauth import OAuth
@chanian
chanian / imax.sh
Created June 16, 2011 18:52
Was that movie originally filmed in IMAX? Or am I paying extra for good marketing...
#!/bin/sh
#
# usage: ./imax.sh "tron 2"
#
# Note, this doesn't always work as it is clearly scrapping imdb.
# comment below for any suggested changes!
#
echo "Was it filmed in IMAX?"
q=`echo $1 | sed -e s/\ /\+/g`
@mbostock
mbostock / .block
Last active December 20, 2022 19:58
Spinny Globe
license: gpl-3.0
redirect: https://observablehq.com/@d3/rotating-orthographic
@mattbornski
mattbornski / timezone.md
Created March 29, 2012 22:36
Determine timezone from lat/long

Goal: To take this: https://graph.facebook.com/105464892820215 And derive this: America/Los Angeles From which we can then derive UTC-0800 or UTC-0700, as appropriate under the daylight madness scheme in effect on the date of interest.

It seems oddly hard to figure out what timezone a given point in space is located in. Looking around, there are only a few APIs which provide this information (http://www.earthtools.org/webservices.htm#timezone and http://www.worldweatheronline.com/time-zone-api.aspx), and only a few datasets which seem to contain it; most of them are in serious GIS formats, and expect you to query them in some manual fashion using a proprietary GIS tool.

I'm not really interested in that; I want a piece of code I can just ask "what timezone is this in" and get an answer, without installing some huge piece of software I don't have a license to or worrying about rate limits from somebody's API. So I'm going to take a shapefile I found here (http://efele.net/maps/tz/world/) and see if we can

@mbostock
mbostock / .block
Last active February 9, 2016 01:26
Icosahedron
license: gpl-3.0
@mbostock
mbostock / .block
Last active August 27, 2018 16:25 — forked from mbostock/.block
Geodesic Rainbow
license: gpl-3.0
redirect: https://beta.observablehq.com/@mbostock/geodesic-rainbow
@billierinaldi
billierinaldi / energy.json
Created September 25, 2012 02:11
Overlapping Sankey links
{"nodes":[
{"name":"Agricultural 'waste'"},
{"name":"Bio-conversion"},
{"name":"Liquid"},
{"name":"Losses"},
{"name":"Solid"},
{"name":"Gas"},
{"name":"Biofuel imports"},
{"name":"Biomass imports"},
{"name":"Coal imports"},
@mbostock
mbostock / .block
Last active October 20, 2023 14:09
General Update Pattern, I
license: gpl-3.0
redirect: https://observablehq.com/@d3/selection-join
@mbostock
mbostock / .block
Last active March 1, 2024 06:07
The Gist to Clone All Gists
license: gpl-3.0