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
# I'm just working on a quick script... | |
true_positives = ... | |
false_negatives = ... | |
# Using printf debugging I'd normally do this | |
p true_positives | |
p false_negatives |
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
delay = (ms, fn) -> | |
setTimeout fn, ms | |
Array::max = -> | |
max = @[0]; | |
for elm in @ when elm > max | |
max = elm | |
max | |
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 NSResponder | |
def acceptsFirstResponder= val | |
(@acceptsFirstResponder = val).tap do | |
instance_eval do | |
def acceptsFirstResponder | |
@acceptsFirstResponder | |
end | |
self | |
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
# Kup. A small all-coffee template language with a syntax like css | |
# | |
# Based on: | |
# * CoffeeKup - https://github.com/mauricemach/coffeekup | |
# * jQuery Builder - https://github.com/quackingduck/jquery.builder.js | |
# TODO: | |
# * stricter regex for tags | |
# The compiler, takes your template and returns a compiled one |
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 Symbol | |
def to_selector | |
"#{self}:".to_sym | |
end | |
end | |
class NSObject | |
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 'rake/clean' | |
CLOBBER.add *File.read('.gitignore').split |
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 'parslet' | |
tree = {:multi=> | |
[{:tag=>{:name=>"Foo"}}, | |
{:block=>{:name=>"Foo", :multi=>[{:static=>"Bar"}]}}]} | |
transformer = Parslet::Transform.new do | |
rule :static => simple(:text) do | |
'STATIC' |
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
# Load environment variables | |
env_path = File.expand_path('../env.yml', __FILE__) | |
YAML.load_file(env_path).each_with_object(ENV) do |(k,v), env| | |
env[k.to_s.upcase] = v.to_s | |
end if File.exists?(env_path) |
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
--- | |
gem: --no-rdoc --no-ri |
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 'fileutils' | |
require 'rubygems' | |
require 'titleize' | |
def is_artist_folder?(path) | |
Dir.glob(File.join(path, "*")).any? { |contained_file| File.directory?(contained_file) } | |
end | |
def get_artist_name(path) |