Skip to content

Instantly share code, notes, and snippets.

View marcus's full-sized avatar
🦉

Marcus Vorwaller marcus

🦉
View GitHub Profile
EmailsController = MVC.Controller.extend('emails',
/* @Static */
{
},
/* @Prototype */
{
load: function(params) {
this.render({action: 'email_index', to: "emails"})
},
# By Louis-Philippe Gauthier
# http://lpgauth.tumblr.com/post/56451143/reverse-geocoding-google-ruby
require 'rubygems'
require 'net/http'
require 'xmlsimple'
def reverse_geocode(lat, lng)
url = "http://maps.google.com/maps/geo?ll=#{lat.to_s},#{lng.to_s}&output=xml"
def select_options_tag(name='',select_options={},options={})
#set selected from value
selected = ''
unless options[:value].blank?
selected = options[:value]
options.delete(:value)
end
select_tag(name,options_for_select(select_options,selected),options)
end
## Create a file called trace_sqllog with the following
#!/usr/sbin/dtrace -qs
pid$1::*dispatch_command*:entry
{
printf("%d::%s\n",tid,copyinstr(arg2));
}
## Taken from http://blogs.sun.com/angelo/entry/observing_mysql_sql_statements_in
@marcus
marcus / gist:336
Created July 21, 2008 21:59 — forked from psi/gist:331
puts "yo momma!"