Skip to content

Instantly share code, notes, and snippets.

View cameroncox's full-sized avatar

Cameron Cox cameroncox

View GitHub Profile
@cameroncox
cameroncox / desktop.ps1
Last active March 11, 2019 11:57 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:

Keybase proof

I hereby claim:

  • I am cameroncox on github.
  • I am cameroncox (https://keybase.io/cameroncox) on keybase.
  • I have a public key ASDB5K6YrBU1Goc-UwgTXAM0p6x519RXyKLCePR0LkgEfwo

To claim this, I am signing this object:

# app/models/activity.rb
class Activity < ActiveRecord::Base
serialize :details
end
# app/controllers/deploys_controller.rb
def create
class ReportMailer < ActionMailer::Base
default from: "admin@hillcrestanimalhospital.co.uk"
def income_by_month_report(report_results)
@report_results = report_results
mail(to: "danny@hillcrestanimalhospital.co.uk", subject: "Monthly Income Report")
end
end
class Clinical < ActiveRecord::Base
# ... snip rest of model...
def self.income_by_month
select( 'YEAR(transactiondate) as year, MONTH(transactiondate) as month, SUM(LineBalance) as income' )
.where(:payment => 0 )
.where('LineBalance <> 0' )
.where('analysiscode <> 213' )
.group(:monthyear)
module Caracal
class DecodeProductId
def initialize(digital_product_id)
@digital_product_id = digital_product_id
end
def self.run(digital_product_id)
new(digital_product_id).decode
end
Arcade Fire
Dr. Dog
Foo Fighters
Harvey Danger
Kings of Leon
The Mars Volta
Minus the Bear
Modest Mouse
Neutral Milk Hotel
Rise Against
#block
background: #000
.reusable-element
color: #FFF
.somecss {
whatever: foo;
no-go: you;
}
@cameroncox
cameroncox / descriptive_sql_load_log.rb
Created July 19, 2011 20:48 — forked from JackDanger/descriptive_sql_load_log.rb
Let Rails display file names and line numbers for log activity.
module ActiveRecord
module ConnectionAdapters
class AbstractAdapter
protected
# Turn:
# User Load (6.3ms) SELECT * FROM "users"
# Into:
# User Load /app/views/_partial.erb:27 (6.3ms) in `_app_views_partial_erb` SELECT * FROM "users"