Skip to content

Instantly share code, notes, and snippets.

@jaredly
jaredly / about.md
Last active September 22, 2016 17:54
Git Tree commands

Here's part of my ~/.gitconfig.global

[user]
	name = Jared Forsyth
...
[alias]
    # View the tree!
    tree = log --oneline --decorate --all --graph
    tr = log --oneline --decorate --all --graph
 t = log --color --date-order --graph --oneline --decorate --simplify-by-decoration --branches
import * from PackTypes.Result
let module P = PackTypes.Parsing
let rec getChild = (children, mapper) => switch children {
case []: None
case [child ...rest]: switch mapper(child) {
case None: getChild(rest, mapper)
case x: x
}
}
let rec getChildren = (children, mapper) => switch children {
type something = | Something 'a :something;
module type ChildType = {let makeSomething: int => something;};
let module MakeThing (ChildA: ChildType) (ChildB: ChildType) => {
type childArg = | A int | B int;
let doThing arg =>
switch arg {
| A n => ChildA.makeSomething 10
| B n => ChildB.makeSomething 5
public class ReactNativeComponent: UIViewController {
let callbacks: [Int]
let properties: [String: AnyObject]
let name: String
init(name: String, properties: [String: AnyObject], callbacks: [Int]) {
self.name = name
self.properties = properties
self.callbacks = callbacks
(defn code-mirror
"Create a code-mirror editor. The parameters:
value-atom (reagent atom)
when this changes, the editor will update to reflect it.
options
:style (reagent style map)
will be applied to the container element
:js-cm-opts
options passed into the CodeMirror constructor
:on-cm-init (fn [cm] -> nil)
{
"title": "Demobox",
"created": 1432725699439,
"opened": 1433371827400,
"repl": "null",
"root": {
"id": "bglg05h4fvzbftq2vnwpv3t1lbbb9pjm",
"created": 1432725699462,
"modified": 1432725699462,
"content": "Demobox",
@jaredly
jaredly / Jupyter Node Example.ipynb
Created April 22, 2015 15:25
Jupyter NodeJS Example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import fs from 'fs'
->
import _fs from 'fs'
const fs = _fs
@jaredly
jaredly / Document.nm
Created April 2, 2015 00:59
Dominex TODO rename
{
"title": "Dominex TODO rename",
"created": 1426174963481,
"opened": 1427936357702,
"repl": "ijs",
"root": {
"id": "777d5hlgtdnv7h3uejxmj3emx7vpvhox",
"created": 1426174963622,
"modified": 1426174963622,
"content": "Dominex TODO rename",
let btn = $('button')[0]
let clicks = Rx.Observable.fromEvent(btn, 'click')
clicks.subscribe(value => console.log('clicked!'))
let values = clicks.map(() => Math.floor(Math.random() * 10 + 2))
let less1 = values.map(value => value - 1)
let times2 = less1.map(value => value*2)
times2.subscribe(value => console.log('i got a value', value))
times2.subscribe(value => console.log('also subscribing', value))