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 Guardable | |
def initialize(obj) | |
@obj = obj | |
end | |
def method_missing(method_name, *args, &block) | |
return @obj if @obj.nil? | |
@obj.send(method_name, *args, &block) | |
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
gulp = require('gulp') | |
plumber = require('gulp-plumber') | |
util = require('gulp-util') | |
sass = require('gulp-ruby-sass') | |
rimraf = require('gulp-rimraf') | |
uglify = require('gulp-uglify') | |
minifyCSS = require('gulp-minify-css') | |
streamify = require('gulp-streamify') | |
size = require('gulp-size') | |
tap = require('gulp-tap') |
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 'pp' | |
BASE_TABLE = [ | |
%w(a b c d e), | |
%w(f g h i j), | |
%w(k l m n o), | |
%w(p q r s t), | |
%w(u v w x y), |
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 'pp' | |
require 'rspec-power_assert' | |
class Point | |
attr_reader :row, :col | |
def initialize(row, col) | |
@row, @col = row, col |
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
# @param [Hash] options Any of :log, :env, :pwd, :command, :stdout_log, :stderr_log, :spawn_options, :spawn_checker, :timeout | |
def spawn_process(options = {}) | |
env = options[:env] || {} | |
command = options[:command] | |
stdout_log = options[:stdout_log] ? [options[:stdout_log], 'w'] : :out | |
stderr_log = options[:stderr_log] ? [options[:stderr_log], 'w'] : :err | |
pwd = options[:pwd] | |
spawn_options = { | |
:out => stdout_log, | |
:err => stderr_log, |
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 CacheByRequest | |
def self.read(key) | |
if Thread.current[:cache_by_request] | |
Thread.current[:cache_by_request].read(key) | |
else | |
raise "before CacheByRequest::Store initialization" | |
end | |
end | |
def self.write(key, val) |
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 'bundler/setup' | |
require 'tapp' | |
class Operator | |
def initialize(left, right) | |
@left = left | |
@right = right | |
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
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileWriter; | |
import java.io.FilenameFilter; | |
import java.io.IOException; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import org.dom4j.Document; | |
import org.dom4j.DocumentHelper; |
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
import java.io.File; | |
import java.io.IOException; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import org.apache.poi.POITextExtractor; | |
import org.apache.poi.extractor.ExtractorFactory; | |
import org.apache.poi.openxml4j.exceptions.InvalidFormatException; | |
import org.apache.poi.openxml4j.exceptions.OpenXML4JException; | |
import org.apache.xmlbeans.XmlException; |
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 TestObject | |
def initialize(name) | |
@name = name | |
@children = [] | |
end | |
def add_child(child) | |
@children << child | |
self | |
end |
OlderNewer