Skip to content

Instantly share code, notes, and snippets.

@robheittman
robheittman / gist:1377837
Created November 18, 2011 21:35
Resizer commands
cp 2011.2/Global/164002.png range/maps/164002.png
convert -thumbnail "478x1000>" 2011.2/Global/164002.png range/thumbs/164002.png
convert -thumbnail "176x500>" 2011.2/Global/164002.png range/minis/164002.png
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -n "$PS1" ]] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
db.org.gogoego.vfs.blobs.files.ensureIndex({filename : 1, uploadDate:1}, {unique:true});
@robheittman
robheittman / gist:866643
Created March 11, 2011 21:50
Call Analytics event tracking from GWT
public static native String track(String event) /*-{
$wnd._gaq.push(['_trackEvent', 'navigation', 'click', event])
}-*/;
@robheittman
robheittman / GoGoEgo.ini
Created February 9, 2011 20:41
Sample cluster config files (in production)
-clean
-vmargs
-DCOMPONENT_CONFIG=instance.ini
-DGetOut=production,verbose,server:21003
-XX:MaxPermSize=256m
-XX:+UseParallelOldGC
-XX:CompileCommand=exclude,org/restlet/engine/http/HeaderReader,readValue
-XX:CompileCommand=exclude,org/restlet/engine/http/PreferenceReader,readPreference
@robheittman
robheittman / gist:813775
Created February 6, 2011 22:21
Add some swap to a micro instance
dd if=/dev/zero of=/mnt/swapfile.swap bs=1M count=1024
mkswap /mnt/swapfile.swap
swapon /mnt/swapfile.swap
def expand(parent)
parent.posts.each do |child|
link = "/collections#{@engine.getPathFor(child)}/rubyfragment.html"
$document.write <<-END
<div><a href='#{link}'>#{child['name']}<a></div>
#{child['description']}
<div style='padding-left: 20px'>
END
expand child
$document.write <<-END
@robheittman
robheittman / gist:806874
Created February 1, 2011 22:38
Some navigation using the Posts API
def expand(parent)
parent.posts.each do |child|
link = "/collections#{@engine.getPathFor(child)}/rubyfragment.html"
$document.write <<-END
<div><a href='#{link}'>#{child['name']}<a></div>
#{child['description']}
<div style='padding-left: 20px'>
END
expand child
$document.write <<-END
@robheittman
robheittman / Gemfile
Created January 13, 2011 19:31
Rails with MongoDB recipe for our Amazon clusters.
source 'http://rubygems.org'
gem 'rails', '3.0.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mongoid', "2.0.0.rc.1"
gem 'bson_ext', "1.1.5"
@robheittman
robheittman / gist:768524
Created January 6, 2011 20:34
A .bashrc on Ubuntu with rvm support
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -n "$PS1" ]] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace