Skip to content

Instantly share code, notes, and snippets.

View bentona's full-sized avatar
💕
💕

Benton Anderson bentona

💕
💕
View GitHub Profile
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1">
<label t="translate(0,346)">
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1">
<label t="translate(0,346)">
bundle exec cap develop deploy --trace
/home/vagrant/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/sshkit-1.1.0/lib/sshkit.rb:3: warning: already initialized constant StandardError
cap aborted!
cannot load such file -- deploy
/vagrant/Capfile:1:in `load'
/vagrant/Capfile:1:in `<top (required)>'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
1) DomEventBinder #hasMetaKey given the shift key is held down returns true:
TypeError: 'undefined' is not an object (evaluating 'this.domEventBinder.hasMetaKey')
at http://localhost:8001/browser/dist/browserified_tests.js:28197
at callFn (http://localhost:8001/node_modules/mocha/mocha.js:4338)
at http://localhost:8001/node_modules/mocha/mocha.js:4331
at http://localhost:8001/node_modules/mocha/mocha.js:4728
at http://localhost:8001/node_modules/mocha/mocha.js:4819
at next (http://localhost:8001/node_modules/mocha/mocha.js:4653)
at http://localhost:8001/node_modules/mocha/mocha.js:4663
at next (http://localhost:8001/node_modules/mocha/mocha.js:4601)
@bentona
bentona / gist:3971e8100853edb48156
Created July 29, 2014 18:58
Determine who is most to blame for files
for i in *; do echo $i && git blame $i --line-porcelain | grep 'author ' | cut -b 8-25 | sort | uniq -c | sort -r | head -n 1; done
@bentona
bentona / gist:164b3c608f08cfd04dff
Last active August 29, 2015 14:15
Benefit on EV of taking max of multiple rolls
def roll
Random.rand(10) + 1
end
# Monte Carlo-in it
(1...10000000).inject(0){ |avg,i| avg += (roll - avg).to_f/i }
(1...10000000).inject(0){ |avg,i| avg += ([roll, roll, roll, roll].max - avg).to_f/i }
# Closed form thx http://math.stackexchange.com/questions/150586/expected-value-of-max-of-iid-variables
module JeremyHash
refine Hash do
def hash_collect
Hash[*(collect_concat {|k, v| yield k, v})]
end
end
end
class FunnelStrategy < ActiveRecord::Base
belongs_to :organization
STATES = State.new [
:company_information,
:strategy_information,
:account_information,
:landing_page,
:email_1,
@bentona
bentona / Sourpatch.rb
Created October 24, 2016 21:36
Simulation to determine (roughly) odds of getting all sour patch kids colors in a pack.
class Pack
attr_accessor :pieces
COLORS = [:blue, :green, :yellow, :red]
def initialize
@pieces = (1..6).map{|_| COLORS.sample }
end
def has_all?
@bentona
bentona / linear_regression.py
Created April 26, 2017 16:41
Linear Regression Carbon Five Summit
%matplotlib nbagg
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import collections as mc
x = [2000, 2001, 2007, 2008, 2013, 2014, 2015, 2016]
y = [5, 8, 14, 18, 38, 46, 63, 72]