This file contains hidden or 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
| module ApiEndpoint | |
| def endpoint_for(id) | |
| id.constantize.eval do | |
| has_many self.underscore, :through => :api_objects, :source => :endpoint, :source_type => self.to_s | |
| end | |
| has_many :api_objects, :as => :endpoint | |
| has_many id, :through => :api_objects | |
| end | |
| end |
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| site :opscode | |
| cookbook "build-essential" | |
| cookbook "mysql" | |
| cookbook "openssl" | |
| cookbook "ohai" | |
| cookbook "yum" |
This file contains hidden or 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
| ruby alfredapp://customsearch/Ruby%20Api%20Dock/ruby/ascii/url=http://apidock.com/ruby/search?query={query} | |
| rails alfredapp://customsearch/Rails%20Api%20Dock/rails/ascii/url=http://apidock.com/rails/search?query={query} | |
| rspec alfredapp://customsearch/Rspec%20Api%20Dock/rspec/ascii/url=http://apidock.com/rspec/search?query={query} | |
| rb alfredapp://customsearch/search%20ruby-doc/rb/ascii/url=http://ruby-doc.org/search.html?cx=011815814100681837392%3Awnccv6st5qk&sa=Search&cof=FORID%3A9&q={query} | |
| github alfredapp://customsearch/Search%20Github%20For/github/ascii/url=http://github.com/search?q={query} |
This file contains hidden or 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
| aug AutoloadVimrc | |
| au! | |
| au BufWritePost ~/dotfiles/vim.symlink/vimrc.symlink source $MYVIMRC | |
| au BufWritePost ~/dotfiles/vim.symlink/*.vim source $MYVIMRC | |
| aug END |
This file contains hidden or 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 << Silent = Object.new | |
| def heard?(other) | |
| other.empty? | |
| end | |
| def respond | |
| "Fine. Be that way." | |
| end | |
| end |
This file contains hidden or 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
| RSpec::Matchers.define :yield_arguments do |*expected_arguments| | |
| chain :in do |block_method, *args| | |
| @block_method = block_method | |
| @method_args = args | |
| end | |
| match do |subject| | |
| @actual_arguments = :no_arguments | |
| block = ->(*args) { @actual_arguments = args } | |
| subject.send(@block_method, *@method_args, &block) |
This file contains hidden or 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 CreditInclusionType < IDontCare | |
| Null = Object.new | |
| class << Null | |
| def by_term? | |
| false | |
| end | |
| def by_credits? | |
| false |
This file contains hidden or 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 Notify | |
| include Weechat | |
| def notify_msg( data, buffer, date, tags, visible, highlight, prefix, message ) | |
| if highlight.to_i != 0 | |
| TerminalNotifier.execute(verbose = false, message: message) | |
| end | |
| return WEECHAT_RC_OK | |
| end |
This file contains hidden or 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 Notify | |
| include Weechat | |
| def notify_msg( data, buffer, date, tags, visible, highlight, prefix, message ) | |
| if highlight.to_i != 0 | |
| TerminalNotifier.execute(verbose = false, message: message) | |
| end | |
| return WEECHAT_RC_OK | |
| end |
This file contains hidden or 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 "data_bank" | |
| class Node < Struct.new(:question, :yes, :no) | |
| def call(*) | |
| puts question | |
| answer = gets | |
| case answer.chomp | |
| when ?y | |
| yes.call(self) |