Skip to content

Instantly share code, notes, and snippets.

@lime
lime / rbenv-patch
Last active January 28, 2016 15:28 — forked from philou/rbenv-patch
This script uses skaes/rvm-patchsets to patch a ruby-build package before installing it with rbenv. It uses ruby 2.1.2 with all patches in the railsexpress patchset, but it should work with any ruby / patch as long as they are compatible.
#!/bin/sh
mkdir /tmp/ruby-build-patch
cd /tmp/ruby-build-patch
# download the patches
git clone git@github.com:skaes/rvm-patchsets.git
# download and rename the ruby-build version definition
wget https://raw.github.com/sstephenson/ruby-build/master/share/ruby-build/2.1.2
from numpy import *
from scipy.stats import beta
class BetaBandit(object):
def __init__(self, num_options=2, prior=(1.0,1.0)):
self.trials = zeros(shape=(num_options,), dtype=int)
self.successes = zeros(shape=(num_options,), dtype=int)
self.num_options = num_options
self.prior = prior
class Player
constructor: (@node, @src) ->
@init()
init: ->
@node.src = @src
@node.play()
event: (type) ->
Bacon.fromEventTarget(@node, type).map ".currentTarget"
begin
require 'launchy'
class Mechanize::Page
def open_in_browser
if body
file = File.new("/tmp/#{Time.now.to_i}.html", 'w')
file.write body
Launchy.open "file://#{file.path}"
system "sleep 2 && rm #{file.path} &"
<!doctype html>
<html ng-app="sampleKinveyApp">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->