Name assets with their final extension, e.g.
application.js.coffee
application.css.scss
… or guard-livereload won’t pick them up properly.
gem "guard-livereload"
var Kitten, Mooer, _ref, | |
__hasProp = {}.hasOwnProperty, | |
__extends = function (child, parent) | |
{ | |
for (var key in parent) | |
{ | |
if (__hasProp.call(parent, key)) child[key] = parent[key]; | |
} | |
function ctor() |
require "ffi" | |
module Sass | |
extend FFI::Library | |
ffi_lib "sass" | |
module MemoryString | |
extend FFI::DataConverter | |
native_type FFI::Type::POINTER |
class Fixnum | |
# Runs a block, catching any exceptions matching the exceptions in the | |
# input parameters. After +self+ number of tries, the exception is | |
# re-raised and the attempts will terminate. | |
# | |
# @yield +self+ | |
# @param [Exception, …] exs Exceptions that will be caught and recovered from. | |
# @return Whatever the block returns. | |
def tries(*exs) | |
exs = [StandardError] if exs.empty? |
# coding: utf-8 | |
require 'thread' | |
class Semaphore | |
def initialize(size = 1) | |
@queue = SizedQueue.new(size) | |
size.times { inc } | |
end | |
def inc |
require "set" | |
class Distance | |
def initialize(target) | |
@target = target.dup | |
end | |
attr_reader :target | |
def calculate(origin) |
# coding: utf-8 | |
class Whitespace | |
def initialize(&block) | |
@data = 0 | |
@pos = -1 | |
instance_eval(&block) | |
end | |
def | |
tap { @pos += 1 } |
source :rubygems | |
gem 'pry' | |
gem 'capybara' | |
gem 'capybara-webkit' | |
gem 'celluloid' |
class TerminateJobs | |
class Terminate < StandardError | |
end | |
include Sidekiq::Util | |
def call(worker, msg, queue) | |
current_thread = Thread.current | |
old_signals = {} |
# Ruby Thread Pool | |
# ================ | |
# A thread pool is useful when you wish to do some work in a thread, but do | |
# not know how much work you will be doing in advance. Spawning one thread | |
# for each task is potentially expensive, as threads are not free. | |
# | |
# In this case, it might be more beneficial to start a predefined set of | |
# threads and then hand off work to them as it becomes available. This is | |
# the pure essence of what a thread pool is: an array of threads, all just | |
# waiting to do some work for you! |