Skip to content

Instantly share code, notes, and snippets.

import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}

Update

sudo apt-get update

Install ZSH & Oh-My-ZSH

sudo apt-get install zsh
@evansagge
evansagge / gist:5437035
Created April 22, 2013 17:44
git pre-commit hook for removing trailing whitespace
#!/bin/sh
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# Find files with trailing whitespace
for FILE in `exec git diff-index --check --cached $against -- | sed '/^[+-]/d' | sed -E 's/:[0-9]+:.*//' | uniq` ; do
@evansagge
evansagge / chef-solo-bootstrap.sh
Last active December 15, 2015 10:29
chef-solo bootstrap
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
tar -xvzf ruby-1.9.3-p392.tar.gz
cd ruby-1.9.3-p392/
./configure --prefix=/usr/local
make
make install
evan@evan-mba~/dev/inf/infinitely$ bundle exec sidekiq
/Users/evan/.rvm/gems/ruby-1.9.3-p0@infinitely/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
2012-05-09T02:18:08Z 19122 TID-oxwx0sqok INFO: Booting sidekiq 1.1.4 with Redis at redis://localhost:6379/0
2012-05-09T02:18:08Z 19122 TID-oxwx0sqok INFO: Running in ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]
2012-05-09T02:18:09Z 19122 TID-oxwwi1q9k INFO: Starting processing, hit Ctrl-C to stop
2012-05-09T02:18:09Z 19122 TID-oxwwtjjxo INFO: Harvesters::SocialNetworks::Timelines MSG-oxwwsdoj0 start
2012-05-09T02:18:09Z 19122 TID-oxwxgj7n8 INFO: Harvesters::SocialNetworks::Timelines MSG-oxwxgj8nc start
2012-05-09T02:18:09Z 19122 TID-oxwxgj7n8 INFO: Harvesters::SocialNetworks::Timelines MSG-oxwxgj8nc done: 0.099 sec
2012-05-09T02:18:09Z 19122 TID-oxwwtjjxo INFO: Harvesters::SocialNetworks::Timelines MSG-oxwwsdoj0 done: 0.11 sec
@evansagge
evansagge / bootstrap.modal.ajax.js.coffee
Created April 6, 2012 22:29
Loading AJAX content into Twitter Bootstrap modal
$ ->
$("*").on "click", "a[data-toggle=modal]", ->
target = $(@).attr('data-target') || $(@).attr('href')
// ajax-ified only when data-target or href is not an anchor
unless (/^#/).test(target)
$.get target, (html) -> $(html).modal()
false
evan-imac:dealgrocer.com evan$ rake test
(in /Users/evan/Projects/dealgrocer/dealgrocer.com)
/Users/evan/.rvm/gems/ruby-1.9.2-p290@dealgrocer.com/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
DEPRECATION WARNING: Yajl's JSON gem compatibility API is going to be removed in 2.0
..................................................................................................................................................................................
NoMethodError: undefined method `[]' for nil:NilClass
- assert_equal "cyx.ucron@gmail.com", opts[:to_email] /Users/evan/Projects/dealgrocer/dealgrocer.com/test/unit/invite.rb +12
.................Can't read environment variable DG_SECRET
@evansagge
evansagge / gist:1277867
Created October 11, 2011 11:32
Ruby question: for loop vs. iterator
# example 1:
values = [1, 2, 3, 4, 5]
current_value = 0
for value in values do
current_value = value
end
puts current_value
# example 2:
values = [1, 2, 3, 4, 5]
<form accept-charset="UTF-8" action="/login" class="simple_form user" method="post">
  <div style="margin:0;padding:0;display:inline">
    <input name="utf8" type="hidden" value="&#x2713;" />
    <input name="authenticity_token" type="hidden" value="gOSX42nc1PcezB8XSuY+aiKSpQZs46un3ZaYpxBI22I=" />
  </div>
  <div class="input string email required">
    <label class="email required" for="user_email">
      <abbr title="required">*</abbr> Email
    </label>
@evansagge
evansagge / gist:964632
Created May 10, 2011 15:01
resque-web error log
ArgumentError: file or block required
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/tilt-1.3/lib/tilt/template.rb:50:in `initialize'
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/sinatra-1.1.3/lib/sinatra/base.rb:514:in `new'
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/sinatra-1.1.3/lib/sinatra/base.rb:514:in `block in compile_template'
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/tilt-1.3/lib/tilt.rb:129:in `fetch'
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/sinatra-1.1.3/lib/sinatra/base.rb:496:in `compile_template'
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/sinatra-1.1.3/lib/sinatra/base.rb:480:in `render'
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/sinatra-1.1.3/lib/sinatra/base.rb:389:in `erb'
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/resque-1.15.0/lib/resque/server.rb:122:in `show'
/Users/evan/.rvm/gems/ruby-1.9.2-head/gems/resque-1.15.0/lib/resque/server.rb:135:in `block (2 levels) in <class:Server>'