This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DecoratorClone | |
def initialize(model) | |
@model = model | |
end | |
def method_missing(m, *args) | |
raise NameError, "Decorator method '#{m}' not found" unless @model.respond_to?(m) | |
@model.send(m, *args) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
# Add the following to your shell init to set up gpg-agent automatically for every shell | |
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
source ~/.gnupg/.gpg-agent-info | |
export GPG_AGENT_INFO | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "active_record" | |
ActiveRecord::Base.establish_connection('postgres:///testing') | |
ActiveRecord::Migration.verbose = false | |
ActiveRecord::Migration.class_eval do | |
create_table :played_quizzes, force: true do |t| | |
t.integer :player_ids, array: true | |
t.json :quiz_snapshot | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Let's try out a table with kramdown class tag | |
| A simple | table | | |
| with multiple | lines| | |
{: .my-class } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Here's what I did to get things working.
Yep, over at: https://developer.apple.com
Source: http://willandorla.com/will/2011/01/convert-folder-into-git-submodule/
$ git clone --no-hardlinks original-repo copied-repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class RubyArchive | |
require 'rubygems/package' | |
require 'zlib' | |
attr_reader :path | |
class Archive |
Inspired by Literate CoffeeScript.
$ cat hello.rb.md
Here's a simple program
puts "Hello, world"
$ ruby litrb.rb < hello.rb.md
Hello, world