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 Foo | |
private_class_method :new | |
singleton_class.prepend(Module.new) | |
public_class_method :new | |
end | |
puts Foo.method(:new) |
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
T::Configuration.call_validation_error_handler = lambda do |signature, opts| | |
method_file, method_line = signature.method.source_location | |
location = opts[:location] | |
suffix = "Caller: #{location.path}:#{location.lineno}\n" \ | |
"Definition: #{method_file}:#{method_line}" | |
error_message = "#{opts[:kind]}#{opts[:name] ? " '#{opts[:name]}'" : ''}: #{opts[:message]}\n#{suffix}" | |
break if opts[:value].is_a?(RSpec::Mocks::Double) |
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
#!/usr/bin/env bash | |
set -e | |
set -x | |
# To run, install aws cli tools | |
# Run aws configure | |
for bucket in `aws s3 ls | cut -d ' ' -f 3`; do | |
# puts each bucket into its own folder |
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
PING 8.8.4.4 (8.8.4.4): 56 data bytes | |
64 bytes from 8.8.4.4: icmp_seq=0 ttl=60 time=42.250 ms | |
64 bytes from 8.8.4.4: icmp_seq=1 ttl=60 time=98.729 ms | |
64 bytes from 8.8.4.4: icmp_seq=2 ttl=60 time=7.611 ms | |
64 bytes from 8.8.4.4: icmp_seq=3 ttl=60 time=8.053 ms | |
64 bytes from 8.8.4.4: icmp_seq=4 ttl=60 time=25.205 ms | |
64 bytes from 8.8.4.4: icmp_seq=5 ttl=60 time=56.228 ms | |
64 bytes from 8.8.4.4: icmp_seq=6 ttl=60 time=92.111 ms | |
64 bytes from 8.8.4.4: icmp_seq=7 ttl=60 time=139.504 ms | |
64 bytes from 8.8.4.4: icmp_seq=8 ttl=60 time=12.042 ms |
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 Tesseract < Formula | |
desc "OCR (Optical Character Recognition) engine" | |
homepage "https://github.com/tesseract-ocr/" | |
url "https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz" | |
sha256 "26cd39cb3f2a6f6f1bf4050d1cc0aae35edee49eb49a92df3cb7f9487caa013d" | |
revision 3 | |
bottle do | |
revision 1 | |
sha256 "19d4caa5ce632ca41d3b45accd7f116f6cf93688531f26437cb4833f26cc0172" => :yosemite |
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
#!/usr/bin/env ruby | |
require 'time' | |
require 'colored' | |
require 'parallel' | |
require 'optparse' | |
class GitBranchDetails | |
NotAGitRepository = Class.new(StandardError) |
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
#!/usr/bin/env ruby | |
require 'time' | |
require 'colored' | |
require 'pry' | |
SPECIAL_BRANCHES = %w( | |
production | |
staging | |
beta |
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
Nokogiri::XML::Node.class_eval do | |
# Print every Node by default (will be overridden by CharacterData) | |
define_method :should_print? do | |
true | |
end | |
# Duplicate this node, replace the contents of the duplicated node with a | |
# newline. With this content substitution, the #to_s method conveniently | |
# returns a string with the opening tag (e.g. `<a href="foo">`) on the first | |
# line and the closing tag on the second (e.g. `</a>`, provided that the |
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
#!/usr/bin/python | |
import urllib | |
import urllib2 | |
import re | |
import json | |
import os | |
from pyquery import PyQuery | |
import codecs |
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
#!/usr/bin/python | |
import sys | |
import re | |
import os | |
import subprocess | |
import pprint | |
def usage(exit=None): | |
if exit == 0: |