Skip to content

Instantly share code, notes, and snippets.

| 1 | 2 | 3 | doors
| | | |
| 1/3 | 1/3 | 1/3 | initial probability
| | | |
| 1/3 | 1/3 | 1/3 | you pick door 1
| | | |
| 1/3 | 0 | 2/3 | he opens door 2 to reveal a goat
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/hash/keys.rb:47:in `assert_valid_keys': Unknown key(s): autosave (ArgumentError)
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:1530:in `create_has_many_reflection'
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:822:in `has_many'
from (eval):3:in `has_many'
from /Users/stacey/Programming/rails/pasteweb/app/models/order.rb:35
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:380:in `load_file'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:379:in `load_file'
from /opt/local/lib/ruby/gems/1.8

Keybase proof

I hereby claim:

  • I am capicue on github.
  • I am capicue (https://keybase.io/capicue) on keybase.
  • I have a public key whose fingerprint is FCD9 92E7 F025 03DA 95A0 A06F E0BD EB62 E20F F530

To claim this, I am signing this object:

@capicue
capicue / head.min.js
Last active August 29, 2015 14:14
Introductions
/**
Head JS The only script in your <HEAD>
Copyright Tero Piirainen (tipiirai)
License MIT / http://bit.ly/mit-license
Version 0.96
http://headjs.com
*/(function(a){function z(){d||(d=!0,s(e,function(a){p(a)}))}function y(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.async=!1,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.done=!0,d())},(a.body||b).appendChild(e)}function x(a,b){if(a.state==o)return b&&b();if(a.state==n)return k.ready(a.name,b);if(a.state==m)return a.onpreload.push(function(){x(a,b)});a.state=n,y(a.url,function(){a.state=o,b&&b(),s(g[a.name],function(a){p(a)}),u()&&d&&s(g.ALL,function(a){p(a)})})}function w(a,b){a.state===undefined&&(a.state=m,a.onpreload=[],y({src:a.url,type:"cache"},function(){v(a)}))}function v(a){a.state=l,s(a.onpreload,function(a){a.call()})}function u(a){a=a||h;var b;for(var c in a){if(a.hasOwnProperty(c)&&a[c].state!=o)return!1;b=!0}
import Html (..)
import Html.Attributes (..)
import Html.Events (..)
import Signal ((<~), Signal)
import Signal
import Markdown
-- MODEL --

Monads and Functors

The Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions.

Monadic Classes

class Functor f where
  fmap :: (a -> b) -> f a -> f b
@capicue
capicue / Main.js
Last active December 10, 2015 19:56
Hexagons 2
var Elm = Elm || { Native: {} };
Elm.Native.Array = {};
Elm.Native.Array.make = function(localRuntime) {
localRuntime.Native = localRuntime.Native || {};
localRuntime.Native.Array = localRuntime.Native.Array || {};
if (localRuntime.Native.Array.values)
{
return localRuntime.Native.Array.values;
}
@capicue
capicue / index.html
Created October 20, 2016 22:59
Elmoji Translator
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Elmoji Translator</title>
<script type="text/javascript" src="main.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css">
<link rel="stylesheet" href="main.css">