Skip to content

Instantly share code, notes, and snippets.

View hamin's full-sized avatar

Haris Amin hamin

  • Currently ionq.co. Previously symbiont.io, getpager.com, itsglimpse.com, dailburn.com
  • New York,NY
View GitHub Profile
@hamin
hamin / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
group :development do
if RUBY_VERSION =~ /1.9/
gem "ruby-debug19"
else
gem "ruby-debug"
end
end
@hamin
hamin / gist:535041
Created August 18, 2010 15:04 — forked from cheald/gist:535026
MongoMapper CarrierWave adapter
require 'mongo_mapper'
module CarrierWave
module MongoMapper
include CarrierWave::Mount
##
# See +CarrierWave::Mount#mount_uploader+ for documentation
#
def mount_uploader(column, uploader, options={}, &block)
# We need to set the mount_on column (or key in MongoMapper's case)
@hamin
hamin / event.rb
Created June 29, 2010 16:04 — forked from stengland/event.rb
Multi Param Atrributes for MongoMapper ruby 1.8 and ruby 1.9 compliant
class Event
include MongoMapper::Document
include MultiParameterAttributes
key :name, String, :required => true
key :start_date, Date, :required => true
key :start_time, Time, :required => true
end