Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Sunderland iterion

View GitHub Profile
View audit.rb
class Audit
include Mongoid::Document
include Mongoid::Timestamps
include RailsAdminImport::Import
class << self
def create_with_type_message_meta(_type, _message, _user)
self.create_without_type_message_meta({
:type => _type,
:content => _message,
@iterion
iterion / add_minutes.rb
Created Dec 7, 2012
Programming example
View add_minutes.rb
class IncorrectTimeFormatError < StandardError; end
class FakeTime
##
# :call-seq:
# FakeTime.add_minutes(time, minutes_to_add) => String
#
# Returns a new string with minutes_to_add added to the time
#
# FakeTime.add_minutes("9:23 AM", 10) #=> "9:33 AM"
@iterion
iterion / nginx.conf
Created Feb 23, 2012
Basic nginx conf file
View nginx.conf
worker_processes 1;
user nginx web;
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024;
accept_mutex off;
use epoll;