Skip to content

Instantly share code, notes, and snippets.

@wh1tney
wh1tney / flow.md
Created August 28, 2014 19:12
Rails Workflow - Getting Started

Rails Workflow

A few simple steps when starting a new Rails project

  • rails new <app_name>

  • Update Gemfile to include gems for testing

    • e.g. RSpec, FactoryGirl, Capybara
@wh1tney
wh1tney / jshatesyou.js
Created August 20, 2014 19:57
JavaScript Hates You
var foo = new Object();
var bar = new Object();
var map = new Object();
map[foo] = "foo"; // --> map["[Object object]"] = "foo";
map[bar] = "bar"; // --> map["[Object object]"] = "bar";
// NOTE: second mapping REPLACES first mapping!
alert(map[foo]); // --> alert(map["[Object object]"]);
// and since map["[Object object]"] = "bar",
@wh1tney
wh1tney / test_helper.rb
Created August 13, 2014 18:36
Rails Test Environment
require "minitest/autorun"
require "mocha/setup"
require 'simplecov'
require 'capybara/dsl'
require 'capybara/rails'
SimpleCov.start
module TestHelper
include Capybara::DSL
@wh1tney
wh1tney / deploy-static-site-heroku.md
Last active September 15, 2024 22:48
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@wh1tney
wh1tney / ruby-twitter-api.md
Last active April 17, 2018 14:30
Quick Introduction to the Ruby Twitter API

Gist

A brief introduction to the Ruby Twitter API, providing code and context.

Note: this tutorial is written using Github Flavored Markdown (GFM) for clarity (and usefulness). It was originally authored by @sylvaincarle and has been edited and updated by @wh1tney (7/26/2014).

Assumptions

  • Ruby is installed and functional
  • The twitter gem is ~ version 5.11.0