Skip to content

Instantly share code, notes, and snippets.

View mhkeller's full-sized avatar

Michael Keller mhkeller

View GitHub Profile
@mhkeller
mhkeller / gist:4140826
Created November 24, 2012 18:32
A list of Amazon EC2 AMIs with R installed
http://www.louisaslett.com/RStudio_AMI/
@mhkeller
mhkeller / gist:4141796
Created November 24, 2012 23:27
Remove row.names
row.names(df) <- NULL
@mhkeller
mhkeller / gist:4141800
Created November 24, 2012 23:28
Remove null rows
df1 <- df[complete.cases(df),]
@mhkeller
mhkeller / CSS
Created December 8, 2012 20:27
Stacked bar chart - http://jsfiddle.net/9pXpU/
.colWrapper{
height:200px;
width:100px;
position:relative;
border:1px solid #ccc;
float:left;
}
.barContainer{
position:absolute;
bottom:0;
@mhkeller
mhkeller / gist:4248002
Created December 10, 2012 02:15
Creating gh-pages from master branch
$ cd repo
$ git checkout --orphan gh-pages
# Creates our branch, without any parents (it's an orphan!)
# Switched to a new branch 'gh-pages'
git rm -rf .
# Remove all files from the old working tree
@mhkeller
mhkeller / gist:4248031
Created December 10, 2012 02:28
Create multigeometry polygon in PostGIS / CartoDB
SELECT ST_Multi(ST_Union(the_geom)) as the_geom, cols... FROM (SELECT cartodb_id, cols...,
ST_Buffer(the_geom,0.0) as the_geom FROM table_name) as
buffered_table GROUP BY value_to_join_on
@mhkeller
mhkeller / gist:4362287
Created December 23, 2012 06:26
There will be time
There will be time, there will be time
To prepare a face to meet the faces that you meet;
There will be time to murder and create,
And time for all the works and days of hands
That lift and drop a question on your plate;
Time for you and time for me,
And time yet for a hundred indecisions,
And for a hundred visions and revisions,
Before the taking of a toast and tea.
@mhkeller
mhkeller / with-thee-conversing.txt
Last active December 10, 2015 01:48
Book IV, Line 639
With thee conversing I forget all time,
All seasons, and their change,--all please alike.
Sweet is the breath of morn, her rising sweet,
With charm of earliest birds; pleasant the sun
When first on this delightful land he spreads
His orient beams on herb, tree, fruit, and flower,
Glist'ring with dew; fragrant the fertile earth
After soft showers; and sweet the coming on
Of grateful ev'ning mild; then silent night
With this her solemn bird and this fair moon,
@mhkeller
mhkeller / gist:4377632
Last active December 10, 2015 03:58
FQL Query for friend list information
$this->api->api(array('method'=>'fql.query','query'=>"SELECT uid,name,first_name,middle_name,last_name,pic_square,hometown_location,current_location,profile_url,email,website FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"));
https://graph.facebook.com/fql?q=SELECT%20uid,name,first_name,middle_name,last_name,pic_square,hometown_location,current_location,profile_url,email,website%20FROM%20user%20WHERE%20uid%20IN%20(SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20=%20me())&access_token=
@mhkeller
mhkeller / gist:4384356
Last active December 10, 2015 04:58
Nesting a JSON object using a value in the data. Cross-browser replacement for d3.nest() .key() .entries()
http://jsfiddle.net/mhkeller/ezvuB/
var sets = [
{
"uid": "a1",
"quote": "hey",
"source": "facebook"},
{
"uid": "a1",
"quote": "yo",