Skip to content

Instantly share code, notes, and snippets.

{"bufs": {"1": {"deleted": true, "path": "FLOOBITS_README.md", "id": 1, "encoding": "utf8"}, "3": {"deleted": false, "path": "foobar.py", "encoding": "utf8", "id": 3, "md5": "c44da112b6ee439efb643bae36ec66e2"}, "2": {"deleted": false, "path": "cows/nope.txt", "encoding": "utf8", "id": 2, "md5": "6a204bd89f3c8348afd5c77c717a097a"}, "4": {"deleted": false, "path": "cows/go/foo/nope.c", "encoding": "utf8", "id": 4, "md5": "11c2c180e5c3c91a6c07f07438516b93"}}, "version": 12, "events": []}
func wut () {
let bar = "nope"
{() -> () in
var foo = "nope"
println(foo)
}()
}
wut()
func myFunctionDoubleVariables (thing: Thing?) {
let foo_ = thing?.getAFoo()
if foo_ == nil {
return;
}
let foo = foo_!
foo.bar()
foo.dostuff()
foo.morestuff()
struct MyStrings {
var strings: [String] = []
func push(str: String) {
strings.append(str)
}
}
func applicationWillTerminate(aNotification: NSNotification!) {
println("closing app!")
}
@btipling
btipling / snake.py
Last active November 22, 2015 04:54 — forked from tarruda/snake.py
# Snake for Neovim! Adapted from https://gist.github.com/sanchitgangwar/2158084
# To install, create a ~/.vim/external-plugin/python/snake.py file with this
# code, then run `nvim -c 'UpdateExternalPlugins' -c 'q'` from a shell.
#
# Make sure you have read the internal help explaining how to setup python
# host for external plugins(:help nvim-python)
#
# To start a new game, use the `:SnakeStart` command on an empty buffer(uses 80
# columns and 20 rows)
from threading import Thread, Lock
#!/bin/bash
export NVIM_PYTHON_LOG_LEVEL=WARNING
export NVIM_PYTHON_LOG_FILE=~/tmp/nvim.log
echo "using ~/tmp/nvim.log"
touch ~/tmp/nvim.log
nvim
echo "all done debugging nvim"
@btipling
btipling / introrx.md
Last active August 29, 2015 14:08 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

$ ps aux | grep python
bjorn 48833 0.4 0.1 2532128 17728 s008 S+ 10:20AM 0:44.83 /usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c import neovim; neovim.start_host()
bjorn 50074 0.4 0.1 2531292 14264 s009 S+ 12:28PM 0:00.51 /usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c import neovim; neovim.start_host()
bjorn 1211 0.0 0.0 2462828 104 s006 S+ Sun05PM 0:00.07 /usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c import neovim; neovim.start_host()
#!/bin/bash
export NVIM_PYTHON_LOG_LEVEL=WARNING
export NVIM_PYTHON_LOG_FILE=~/tmp/nvim.log
touch ~/tmp/nvim.log
nvim