Instantly share code, notes, and snippets.

View failures.log
▶ TIMEOUT [expected OK] /websockets/Create-Secure-extensions-empty.htm
▶ Unexpected subtest result in /websockets/Create-Secure-extensions-empty.htm:
└ NOTRUN [expected PASS] W3C WebSocket API - Create Secure WebSocket - wsocket.extensions should be set to '' after connection is established - Connection should be closed
▶ Unexpected subtest result in /websockets/Create-Secure-extensions-empty.htm:
│ FAIL [expected PASS] W3C WebSocket API - Create Secure WebSocket - wsocket.extensions should be set to '' after connection is established - Connection should be opened
│ → assert_equals: extensions should be empty expected (string) "" but got (undefined) undefined
│ @http://web-platform.test:8000/websockets/Create-Secure-extensions-empty.htm:9:13
View tickertape.log
iex(5)> import Stockastic.Tickertape, only: [connect!: 2, loop!: 2]
nil
iex(6)> connect!("KAH40660714", "TYHBEX") |> loop!(fn(text) -> IO.puts(text) end)
{"ok":true,"quote":{"symbol":"PMI","venue":"TYHBEX","bid":7947,"bidSize":57,"askSize":0,"bidDepth":26743,"askDepth":0,"last":7617,"lastSize":92,"lastTrade":"2015-12-18T05:14:05.115858945Z","quoteTime":"2015-12-18T05:14:10.030310726Z"}}
{"ok":true,"quote":{"symbol":"PMI","venue":"TYHBEX","bid":7947,"bidSize":57,"askSize":0,"bidDepth":13400,"askDepth":0,"last":7617,"lastSize":92,"lastTrade":"2015-12-18T05:14:05.115858945Z","quoteTime":"2015-12-18T05:14:10.03139461Z"}}
{"ok":true,"quote":{"symbol":"PMI","venue":"TYHBEX","bid":7947,"bidSize":57,"askSize":0,"bidDepth":57,"askDepth":0,"last":7617,"lastSize":92,"lastTrade":"2015-12-18T05:14:05.115858945Z","quoteTime":"2015-12-18T05:14:10.032434757Z"}}
...
View out.log
 0:00.91(B LOG: MainThread INFO(B Using 8 client processes
 0:00.94(B LOG: MainThread INFO(B Generating new CA in /var/folders/py/jqgj6kjs5fl3pcjnk916ljrr0000gp/T/tmpPYhIJE
 0:00.99(B PROCESS_OUTPUT: MainThread (pid:89918) Full command: /usr/local/bin/openssl req -config /var/folders/py/jqgj6kjs5fl3pcjnk916ljrr0000gp/T/tmpPYhIJE/openssl.cfg -batch -new -newkey rsa:2048 -keyout /var/folders/py/jqgj6kjs5fl3pcjnk916ljrr0000gp/T/tmpPYhIJE/cakey.pem -out /var/folders/py/jqgj6kjs5fl3pcjnk916ljrr0000gp/T/tmpPYhIJE/careq.pem -subj /CN=web-platform-tests -passout pass:web-platform-tests
(pid:89918) "Generating a 2048 bit RSA private key
..............+++
........+++
writing new private key to '/var/folders/py/jqgj6kjs5fl3pcjnk916ljrr0000gp/T/tmpPYhIJE/cakey.pem'
-----
"
 0:01.01(B PROCESS_OUTPUT: MainThread (pid:89919) Full command: /usr/local/bin/openssl ca -config /var/folders/py/jqgj6kjs5fl3pcjnk916ljrr0000gp/T/tmpPYhIJE/openssl.cfg -batch -create_serial -keyfil
View gist:c7949126f041c6df725f
$ RUST_LOG=debug ./mach test-wpt tests/wpt/web-platform-tests/websockets/interfaces/WebSocket/events/018.html
Running 1 tests in web-platform-tests
Ran 1 tests finished in 24.0 seconds.ket/events/018.html
• 1 ran as expected. 0 tests skipped.
View gulpfile.babel.js
import gulp from 'gulp';
import postcss from 'gulp-postcss';
import sourcemaps from 'gulp-sourcemaps';
import cssnano from 'cssnano';
import autoprefixer from 'autoprefixer';
import lost from 'lost';
import {create as bsCreate} from 'browser-sync';
const browserSync = bsCreate();
const dirs = {
View compose.py
def compose(*funcs):
return lambda x: reduce(lambda acc, f: f(acc), funcs[::-1], x)
def double(x):
return x + x
def square(x):
return x * x
print(compose(double, square)(2)) #=> 8
View github-trello.md

Github

Pros

  • Pull requests are the thing for getting dev done, seeing what others have done, and discussing it. I love pull requests.

Cons

  • Developer-centric workflow that doesn't provide much value to the rest of the business, because it has no interest in that at all.
  • Not particularly flexible organization of anything, milestones are a bit clunky to use, so it's mostly just labels.

Neutral

  • Individual issues are a pretty good place for discussion, but not a killer feature at all like PRs.
View min_by.rb
def min_by(ary, fn)
first, *rest = ary;
min_elem, _ = rest.reduce([first, fn.call(first)]) do |(min_elem, min), new_elem|
if (new_min = f.call(new_elem)) < min
[ new_elem, new_min ]
else
[ min_elem, min ]
end
end
min_elem
View quarter.lua
-- Returns a function that can be used to move into quarter grid
function quarter(horiz, vert)
local win = window.focusedwindow()
local newframe = win:screen():frame_without_dock_or_menu()
local halfw = newframe.w / 2
local halfh = newframe.h / 2
newframe.h = horiz == "full" and newframe.h or halfh
newframe.w = vert == "full" and newframe.w or halfw
newframe.y = horiz == "bottom" and halfh or newframe.y
View game.scala
class IO[A] private (run0: => A) {
def run = run0
def flatMap[B](f: A => IO[B]): IO[B] = {
IO(f(run).run)
}
def map[B](f: A => B): IO[B] = flatMap(a => IO(f(a)))
}