Skip to content

Instantly share code, notes, and snippets.

-- Explicitly stating the order of computation `a (b c)` makes this not compile
-- While, if we used a C style, order of computation would be explicit by default `a(b(c))` vs `a(b, c)`
example1 = a b c
where
a first second = first ++ second
b = "hey"
c = " world"
-- Explicitly stating `a (b c)` makes this compile
example2 = a b c
Arduino
1. $65.94 -- Buy Ardunio Yun -- http://www.amazon.com/Arduino-A000008-Y%C3%9AN/dp/B00F6YJK3S
2. $8.95 -- Buy LCD Shield -- http://www.amazon.com/ZITRADES-Keypad-Display-Arduino-Duemilanove/dp/B00BOMPW60
3. $6.97 -- Buy Jumper Cables -- http://www.amazon.com/RioRand-Dupont-Male-Male-Female-Female-Female-Male/dp/B00J5NSOVA
3. Program ticker software
4. ???
5. Profit!
Total $81.86
a = 5
b = 3
c = a + b = 15
a a a a a
b c c c c c
b c c c c c
b c c c c c
number_of_atoms = 10e80 -- quantity
size_of_universe = 46e9 * 3.15569e7 -- light years to seconds
smallest_distance = 5.3910632e-44 -- seconds
speed_of_light = 299792458
bits_in_universe = (
{- x -} log(size_of_universe / smallest_distance) / log(2)
{- y -} + log(size_of_universe / smallest_distance) / log(2)
sudo ln -s /usr/bin/docker /usr/bin/donger
@munro
munro / dom.html
Last active August 29, 2015 14:06
AngularJS Window Title
<html>
<head>
<title ng-bind="window_title"></title>
</head>
</body>
@munro
munro / integerAddition.rs
Last active August 29, 2015 14:05
Integer addition
use std::fmt;
#[deriving(Clone)]
enum MyInteger {
Zero(Box<MyInteger>),
One(Box<MyInteger>),
End
}
/**
@munro
munro / integerAddition.hs
Created August 22, 2014 20:38
Integer addition in Haskell without built in functions
data MyInteger = Zero MyInteger | One MyInteger | End
-- | Show integer
-- >>> show (One $ One $ Zero $ Zero $ Zero $ End)
-- "11000b"
-- >>> show (End)
-- "b"
instance Show MyInteger where
show (Zero rest) = "0" ++ show rest
show (One rest) = "1" ++ show rest
fetchDependencies: (version, value) ->
promises = []
for x in version.dependencies
promise = @searchTerm(x.name).then (data) =>
d = _.first(data)
dep_search = _.last(d.versions)
if dep_search.scripts.length > 0
el = document.createElement("script")
el.setAttribute("data-require", value.name + "@*")
el.setAttribute("data-semver", version.semver)