Skip to content

Instantly share code, notes, and snippets.

@poteto
poteto / upgrade-mavericks-yosemite-rails.markdown
Last active December 12, 2016 14:58
Upgrading from Mavericks to Yosemite for Rails Devs

Upgrading from OSX Mavericks to OSX Yosemite (10.10)

Before upgrading to Yosemite, read this first, as your upgrade could potentially take a few hours if you have a large /usr folder. After the upgrade finishes, log in to OS X and install all updates in the App Store. Once the updates are done, do the following:

1. Install the latest Xcode CLT

xcode-select --install

2. Install Xcode 6.1

@erichurst
erichurst / mod_machine.rb
Last active August 29, 2015 13:56
Simple module for dynamic values
module ModMachine
extend ActiveSupport::Concern
included do
end
module ClassMethods
#
# Builds a module with constants assigned to the index passed in the `options` array. Be sure
# to pass all arguments as you would write them manually. In other words `attribute` and any
Writing a billing system in Haskell, using Stripe and Heroku
===
*This post is written in literate Haskell, meaning the source can be turned
into a blogpost or a working program. You can view the [source][source].
[source]: https://gist.github.com/gatlin/7754289
Normally clients pay me with checks, but recently one informed me that they
really really really like *really really* super prefer some kind of online
@xaviershay
xaviershay / application_controller.rb
Created July 12, 2011 02:21
Helpers outside your view
class ApplicationController
# Provide access to helper methods from outside controllers and views,
# such as in Presenter objects. Rails provides ActionController::Base.helpers,
# but this does not include any of our application helpers.
def self.all_helpers
@all_helpers_proxy ||= begin
# Start with just the rails helpers. This is the same method used
# by ActionController::Base.helpers
proxy = ActionView::Base.new.extend(_helpers)
@aslakhellesoy
aslakhellesoy / chess.feature
Created January 26, 2011 00:38
Let's cuke some chess...
Feature: Validate moves
Scenario: Moving the knight illegally
Given the following board:
| | | | | | | | |8|
| | | | | | | | |7|
| | | | | | | | |6|
| | | | | | | | |5|
| | | |♞| | | | |4|
| | | | | | | | |3|
|♙| | | | | | | |2|