- Jim Weirich: The Building Blocks of Modularity – http://goo.gl/g4Nk
- Jim Weirich: SOLID Ruby – http://goo.gl/z3jd
- Sandi Metz: SOLID Object-Oriented Design – http://goo.gl/PDn6T
- Sandi Metz: Less – The Path to Better Design – http://goo.gl/VuTl4
- Demeter is for Encapsulation – http://is.gd/eeyLx
- Opinionated Modular Code – http://is.gd/eeyXm
- Scaling to Hundreds of Millions of Requests – http://vimeo.com/12814529
- Confident Code – http://goo.gl/VFLX
- Destroy All Software Screencasts – https://www.destroyallsoftware.com/screencasts
- Corey Haines: Fast Rails Tests – http://goo.gl/Va2gb
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 HashTree < Hash | |
def self.new | |
super { |h, k| h[k] = new(&h.default_proc) } | |
end | |
def path=(*nodes, value) | |
k = nodes.shift | |
if nodes.empty? | |
self[k] = value | |
else |
This attempt is fairly easy, creates a form which takes href of the link as action, method is always POST
and adds the _method
param. The link onclick's, prevents the default event functionality and submits such form instead.
//method_override.js
methodOverride = function(){
handler = function(event){
event.preventDefault();
form = document.createElement('form');
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 'forwardable' | |
module Hobbit | |
class Base | |
class << self | |
extend Forwardable | |
def_delegators :stack, :map, :use | |
%w(DELETE GET HEAD OPTIONS PATCH POST PUT).each do |verb| |
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
#!/bin/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
api_key = ENV['KEY'] | |
uri = URI('https://android.googleapis.com/gcm/send') | |
msg = ARGV.shift | |
ids = ARGV |
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 'gosu' | |
class Window < Gosu::Window | |
attr_accessor :hyperspace | |
def initialize(width, height) | |
super(width, height, false) | |
@hyperspace = HyperSpace.new | |
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
#!/bin/bash | |
# This script allows you to chroot ("work on") | |
# the raspbian sd card as if it's the raspberry pi | |
# on your Ubuntu desktop/laptop | |
# just much faster and more convenient | |
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689 | |
# make sure you have issued |
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 Verify | |
attr_reader :subject | |
def initialize(subject) | |
@subject = subject | |
end | |
def eq(b) | |
if subject == b | |
puts "\e[38;5;51m +1 \e[0m" |
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 Markov | |
PHRASE_SEPARATOR = /[\.;]/ | |
WORD_SEPARATOR = " " | |
attr_reader :knowledge, :order | |
def initialize(order: 2) | |
@knowledge = {} | |
@order = order | |
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
echo | |
echo | |
echo "+================================+" | |
echo "| you have been hacked!. Sorry |" | |
echo "+================================+" | |
echo |