Skip to content

Instantly share code, notes, and snippets.

View tobyhede's full-sized avatar
👨‍🚀
...

Toby Hede tobyhede

👨‍🚀
...
View GitHub Profile
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git
@tobyhede
tobyhede / pedantically_commented_playbook.yml
Created September 26, 2012 01:47 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@tobyhede
tobyhede / index.txt
Created June 19, 2012 10:22 — forked from aschoerk/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@tobyhede
tobyhede / .rspec
Created June 10, 2012 00:40 — forked from coreyhaines/.rspec
Loading just active record
--colour
-I app
@tobyhede
tobyhede / index.txt
Created February 22, 2012 03:10 — forked from mmcgrana/index.txt
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@tobyhede
tobyhede / async.coffee
Created July 31, 2011 11:07 — forked from tcr/async.coffee
Serial/Parallel functions in CoffeeScript
# Asynchronous DSL for CoffeeScript
serial = (f) ->
next = -> arr.shift().apply(null, arguments) if arr.length
arr = (v for k, v of f(next))
next()
null
parallel = (f, after = ->) ->
res = {}; arrc = 0

Continuous CoffeeScript testing with Guard and Jasmine

This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo

  • Install Gems with Bundler with bundle install
  • Define your guards with mate Guardfile
  • Initialize Jasmine with bundle exec jasmine init
  • Configure Jasmine with mate spec/support/yasmine.ym
  • Start Guard with bundle exec guard
@tobyhede
tobyhede / survey
Created November 1, 2009 11:04 — forked from radar/survey.md
What did you do to get good at Rails?
Initially started with the Agile Web Dev with Rails book, used that to build an all-AJAX Twitter app back when Twitter was shiney and new. Demo'd that to work and that rolled into a pilot project using Ruby/Rails to tie a couple of backend APIs together into a reporting app. I decided I loved it all so much that I began some client projects on the side.
Who taught you what you know?
Mostly self-taught ... worked with other techs for many years, so most of the learning was in details of Ruby and the platform rather than "oh this is a model" level.
Do you have any fond (or not so fond) memories of your learning experiences?
The first time I built AJAX using about 3 lines of code. Coming from PHP and Java this was all previously manual. These days everyone has been inspired by Rails, but it's very easy to forget that at the time it was so far aheadf of the curve it was like magic.
What was your first production app and what did you learn from it?
@tobyhede
tobyhede / vsjsonp.js
Last active August 29, 2015 14:13 — forked from juliocesar/vsjsonp.js
// VSJONP ― Very Simple JSONP
// ==========================
//
// Usage:
// fetchJsonP({
// url: 'http://shit-no-cors.json',
// complete: function(response) {
// console.log(response);
// }
// });
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}