I hereby claim:
- I am aflatter on github.
- I am aflatter (https://keybase.io/aflatter) on keybase.
- I have a public key ASBYWX2aLIubpZMajGoWwIjWI0XiIPkqUEU2Dq8eAuZdxQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# An empty hash does not result in creating a new instance of the type. | |
# Required because that's what we get back from the relation. | |
class OptionalCoercer | |
def initialize(type) | |
@type = type | |
end | |
def call(value) | |
return unless value | |
value.values.any? ? type.new(value) : nil |
require 'scrypt' | |
module Virtus | |
class Attribute | |
class Password < ::Virtus::Attribute | |
primitive SCrypt::Password | |
def coerce(value) | |
value ? SCrypt::Password.new(value) : nil | |
rescue SCrypt::Errors::InvalidHash |
require 'bundler' | |
require 'erb' | |
# Generates a Nix expression for bundler-managed dependencies. | |
module Bundix | |
class << self | |
def run(gemfile = './Gemfile', lockfile = 'Gemfile.lock') | |
gems = resolve_deps(gemfile, lockfile) | |
checksums = compute_checksums(gems) | |
write_expr(gems, checksums) |
require 'celluloid' | |
def pusher(condition) | |
sleep 5 | |
condition.signal 'Wibble' | |
end | |
def puller(condition) | |
value = condition.wait | |
puts "Pulled: #{value}" |
require 'celluloid' | |
class FuturePlexer | |
class DrainedError < StandardError; end | |
attr_accessor :futures | |
def initialize(futures) | |
self.futures = futures | |
end |
<html> | |
<head> | |
<title>Test</title> | |
<style type="text/css"> | |
div { | |
position: absolute; | |
height: 200px; | |
} | |
.slide { |
var app = require('app') | |
var assert = require('assert') | |
var db = app.db; | |
var get_state = function(cb) { | |
db.get('_state', function(err,doc) { | |
if(err) { |
var app = require('app') | |
var assert = require('assert') | |
var db = app.db; | |
var get_state = function(callback) { | |
db.get('_state', function(err,doc) { | |
if(err) { |
var common = require('../common'), | |
assert = common.assert; | |
var Script = process.binding("evals").Script; | |
var sandbox = Script.createContext({x: "x"}); | |
sandbox.window = sandbox; | |
//Script.runInContext("window = this;", sandbox); |