Skip to content

Instantly share code, notes, and snippets.

@mconnell
mconnell / gist:3852509
Created October 8, 2012 13:21
open root, add openssh
Mark C. Set root password on new vm:
sudo -s -H
sudo passwd
aptitiude install openssh-server
11:55 AM
Mark C. ssh [email protected]
password: root
Acquisition: users come to the site from various channels
Activation: users enjoy 1st visit: “happy” user experience
Retention: users come back, visit site multple times
Referral: users like product enough to refer others
Revenue: users conduct some monetisation behaviour
@mconnell
mconnell / gist:3706812
Created September 12, 2012 14:02
git history
git config --global alias.history "log --graph --pretty=\"format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset\""
git history
# http://news.ycombinator.com/item?id=4130494
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
rake aborted!
undefined local variable or method `shit' for main:Object
/Users/pairing/workspaces/ruby/enigma/Rakefile:8:in `<top (required)>'
(See full trace by running task with --trace)
class Matrix
def []=(i, j, x)
@rows[i][j] = x
end
end
@mconnell
mconnell / gist:1404513
Created November 29, 2011 11:37
Fuck you Lion
defaults write com.apple.Terminal NSQuitAlwaysKeepsWindows -bool false
  • Bookmark a page in safari, any page, this page even.

  • Open up your bookmarks, right click on the bookmark you just created 'Edit Name' and set it to be 'Mp3'

  • Right click again this time selecting 'Edit Address', delete what's there and paste in this:

    javascript:var sourceUrl='/serve/source/'+activeItem.id+'/'+activeItem.key;var xhr=new XMLHttpRequest();xhr.open("GET",sourceUrl,false);xhr.send();var downloadUrl=JSON.parse(xhr.responseText).url;jQuery('#player-nowplaying').html('Download .mp3 File (right click and save as..)');

  • Drag the bookmark into bookmarks bar so you can see it all the time on your browser;

@mconnell
mconnell / gist:1122314
Created August 3, 2011 10:06
Installing PG on OSX 10.6
Install PG from binary + rubygem
PATH=$PATH:/Library/PostgreSQL/9.0/bin gem install pg
function Weather(locationName){
var locationURL = "http://www.google.com/ig/api?weather="+locationName;
var forcast = {};
$.get(locationURL, function(data){
var current = $(data).find('current_conditions');
['condition', 'temp_f', 'temp_c', 'humidity', 'wind_condition'].forEach(function(attribute){
forcast[attribute] = $(current).find(attribute).attr('data');
});
});