Skip to content

Instantly share code, notes, and snippets.

Tom Brooke tbrooke

Block or report user

Report or block tbrooke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7be6133edc996e3799edd3bdbe40af17
## Cocoon Docs: https://github.com/nathanvda/cocoon
Callbacks (upon insert and remove of items)
On insertion or removal the following events are triggered:
cocoon:before-insert: called before inserting a new nested child, can be canceled
cocoon:after-insert: called after inserting
cocoon:before-remove: called before removing the nested child, can be canceled
View deploy.rb
require "rvm/capistrano"
require "bundler/capistrano"
load "config/recipes/unicorn"
load "config/recipes/monit"
#load "config/recipes/nginx"
set :application, "pantry"
set :repository, "git@github.com:MainStMission/food-pantry-manager.git"
set :user, 'msmuser'
set :ssh_options, {:forward_agent => true}
set :use_sudo, false
View cap Log
food-pantry-manager git:(azure-deployment) bundle exec cap deploy
triggering load callbacks
* 2018-06-27 07:55:13 executing `deploy'
triggering before callbacks for `deploy'
* 2018-06-27 07:55:13 executing `deploy:check_revision'
* 2018-06-27 07:55:13 executing `deploy:update'
** transaction: start
* 2018-06-27 07:55:13 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:MainStMission/food-pantry-manager.git azure-deployment"
View Harvest.html.haml
%section.panel
%header
%h1
%i.icon-home.icon-large
&nbsp&nbsp&nbspHouseholds
.content
.span12
.span-one-third
= image_tag('second_logo.jpg')
#harvest_report
View Query Overview
Queries for Harvest Report
1 Shrink the amount of data with a scope in class Visit < ActiveRecord::Base
scope :harvest_visits, -> { where('visited_on >= ?', 3.months.ago )}
All Records (Rails Console):
Visit.all.count
Visit Load (408.3ms) SELECT "visits".* FROM "visits" ORDER BY visited_on DESC
View Harvest View
%section.panel
%header
%h1
%i.icon-home.icon-large
&nbsp&nbsp&nbspHouseholds
.content
.span12
.span-one-third
= image_tag('second_logo.jpg')
#harvest_report
View gist:92c68d49325b5564868214d7689a6e5c
;;; AOM installed
aom git:(master) boot develop
Starting file watcher (CTRL-C to quit)...
Writing pom.xml and pom.properties...
Writing aom-0.1.0-SNAPSHOT.jar...
Installing aom-0.1.0-SNAPSHOT.jar...
@tbrooke
tbrooke / keybase.md
Created Jan 23, 2016
Keybase Identity
View keybase.md

Keybase proof

I hereby claim:

  • I am tbrooke on github.
  • I am tbrooke (https://keybase.io/tbrooke) on keybase.
  • I have a public key whose fingerprint is 99F7 B22B F4FC B96D C350 7D9E B3E4 EDB9 7800 376B

To claim this, I am signing this object:

@tbrooke
tbrooke / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View .vimrc
set nocompatible
runtime macros/matchit.vim
if has("autocmd")
filetype indent plugin on
endif
filetype off
let mapleader=" "
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
You can’t perform that action at this time.