Skip to content

Instantly share code, notes, and snippets.

View shwoodard's full-sized avatar

Sam Woodard shwoodard

View GitHub Profile
@shwoodard
shwoodard / install-go
Created May 28, 2017 13:31 — forked from anonymous/install-go
Install go from src. Usage bin/install-go <version>
#!/bin/bash
set -ex
TMP_DIR=`pwd`/tmp
BUILD_DIR=$TMP_DIR/build
BUILD_GO_DST=$HOME/opt/lang/go1.4
FINAL_GO_DST=$HOME/opt/lang/go$1
rm -rf $TMP_DIR
import Ember from 'ember';
export default Ember.Component.extend({
cmdClickWorks: false,
actions: {
log() {
console.log('I logged');
}
}
});
@shwoodard
shwoodard / gist:1da2222221197708f4af1f23f6fd1577
Created June 14, 2016 10:06 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@shwoodard
shwoodard / statsd.md
Created November 23, 2015 14:38 — forked from trusche/statsd.md
Installing graphite and statsd on OS X Yosemite

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Graphite

Install Cairo

There's an issue with cairo 14.x that results in the axis fonts on the graphs being HUUUUUGE. Downgrading to 12.6 helps:

@shwoodard
shwoodard / app.adapters.stop.js
Created October 22, 2015 13:59 — forked from pablobm/app.adapters.stop.js
Adding parameters to query
import Ember from 'ember';
import ApplicationAdapter from 'london-waits/pods/application/adapter';
import config from 'london-waits/config/environment';
function readStopId(id) {
return id.split(':')[0];
}
export default ApplicationAdapter.extend({
pathForType(type) {
@shwoodard
shwoodard / gist:61930eb1864a02efc4b4
Created April 18, 2015 15:33
ember-cli build error
Features are not specified
Error: Features are not specified
at getOptions (/Users/samwoodard/nest/store/frontend/nlstore/node_modules/ember-cli-defeatureify/index.js:45:11)
at Class.module.exports.included (/Users/samwoodard/nest/store/frontend/nlstore/node_modules/ember-cli-defeatureify/index.js:17:20)
at EmberApp.<anonymous> (/Users/samwoodard/nest/store/frontend/nlstore/node_modules/ember-cli/lib/broccoli/ember-app.js:312:15)
at Array.filter (native)
at EmberApp._notifyAddonIncluded (/Users/samwoodard/nest/store/frontend/nlstore/node_modules/ember-cli/lib/broccoli/ember-app.js:307:45)
at new EmberApp (/Users/samwoodard/nest/store/frontend/nlstore/node_modules/ember-cli/lib/broccoli/ember-app.js:103:8)
at Object.<anonymous> (/Users/samwoodard/nest/store/frontend/nlstore/Brocfile.js:5:11)
at Module._compile (module.js:460:26)
class Bank::LuhnValidator
def self.valid_credit_card_number?(card_number)
valid = true
# Input requirements dictate that the card_number
# be numeric and that it be upto 19 characters
valid &= card_number.is_a?(Integer) &&
(1..19).cover?(card_number.to_s.size)
valid &= luhn_valid?(card_number)
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Programme::Application.load_tasks
namespace :js do
task :test do
chdir 'client' do
container = new Ember.Container()
controller = KanbanGuru.ProjectController.create(container: container, needs: [])
container.register('controller:project', KanbanGuru.ProjectController)
module "Creating a task on the index page."
test "has a new task input and header", ->
visit("/").then ->
equal "Kanban Guru", find('h1').text(), "Header 1 should read, 'Kanban Guru'"
ok find('.new_task_body').is('input[type=text]'), "new task body input should be a text field"