Skip to content

Instantly share code, notes, and snippets.

begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@kjellm
kjellm / app.rb
Last active July 26, 2021 04:46
Event Source proof of concept. Copyright 2017 Kjell-Magne Øierud. License: MIT https://opensource.org/licenses/MIT
require_relative 'base'
require_relative 'event'
require_relative 'cmd'
require_relative 'crud'
require_relative 'model'
require_relative 'read'
require 'pp'
class Application < BaseObject
@vojtajina
vojtajina / get-last-modified-fixed.js
Created August 7, 2012 09:14
Example of predictableNextTick
var fs = require('fs');
var getLastModified = function(files, done) {
var timestamps = new Array(files.length);
var pending = files.length;
files.forEach(function(file, idx) {
fs.stat(file, function(err, stat) {
timestamps[idx] = stat.mtime;
@ryanb
ryanb / spec_helper.rb
Created September 12, 2011 21:29
Focus on specific specs in RSpec
# add this to your spec helper
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end
# and then use the :focus tag in your specs
it "does something awesome", :focus do