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/sh | |
echo $( | |
find app/controllers -path app/controllers/concerns -prune -o -type f | wc -l | |
) / $(( | |
$(egrep -r -l '<\s*ActiveRecord::Base' app/models | wc -l) | |
+ $( | |
( | |
[ -d app/models/concerns ] && | |
find app/models/concerns -type f | wc -l |
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 | |
gem 'activerecord' | |
gem 'minitest' | |
require 'active_record' | |
require 'minitest/autorun' | |
ActiveRecord::Base.establish_connection( | |
adapter: 'postgresql', | |
database: 'playground' |
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
$ godaddy buy wynn.fm | |
-- Reading CC Info from .godaddy... | |
-- THANK YOU FOR PURCHASING YOUR DOMAIN WITH GODADDY! | |
-- WHILE OUR SERVERS THINK ABOUT REGISTERING YOUR DOMAIN | |
-- NAME, PLEASE GIVE CAREFUL CONSIDERATION TO THE | |
-- FOLLOWING SPECIAL OFFERS!!! | |
Would you like to also register the following and SAVE 64%? | |
wynn.net |
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 Module | |
private | |
def delegate(*args) | |
dest, prefix = _extract_valid_delegation_options(args.pop) | |
_define_delegators(caller_locations.first, prefix, dest, args) | |
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
server { | |
listen 80; | |
server_name venture.mydomain.com; | |
return 301 https://venture.mydomain.com$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name venture.mydomain.com; |
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 | |
# ... some resources regarding escape sequences ... | |
# man console_codes | |
# http://en.wikipedia.org/wiki/ANSI_escape_code | |
# http://rtfm.etla.org/xterm/ctlseq.html | |
# http://linuxgazette.net/137/anonymous.html | |
# http://wiki.archlinux.org/index.php/Color_Bash_Prompt | |
# http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlvt100.html | |
# http://pushpopnil.info/post/804629866/zsh-cursor-color-vi-mode |
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 | |
require 'minitest/autorun' | |
class Reorder | |
SINGLE_CHAR = /./ | |
def initialize(word, order) | |
@word, @order = word, 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
class DotContext < String | |
def initialize(val = '.') | |
val = '.' # Ensure we're always a dot | |
super | |
freeze | |
end | |
def to_s | |
self |
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 | |
require './dancer' | |
require './gangnam_style' | |
dancer = Dancer.new('PSY', GangnamStyle.new) | |
dancer.dance! |
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 | |
require './injection' | |
require 'pry' | |
class CallTracker < BasicObject | |
attr_reader :tracked_calls | |
def initialize | |
@tracked_calls = ::Hash.new { |h, k| h[k] = 0 } |
NewerOlder