Skip to content

Instantly share code, notes, and snippets.

// a broadcast-channel-ification of https://github.com/mkruisselbrink/navigator-connect/issues/1#issuecomment-62989902
var discoveryService = new BroadcastChannel("discoveryservice");
// service discovery
var serviceChannelName = "appservice"
var notifyService = new BroadcastChannel(serviceChannelName);
setTimeout(function(){
discoveryService.postMessage({ service: "net.yoyodyne.Notify", channel: serviceChannelName });
},100)
@rektide
rektide / jmicron-uasp.dmesg
Created February 26, 2015 05:33
jmicron-based-ztc-uasp-m2.dmesg
[ 1392.606894] usb 2-2: new SuperSpeed USB device number 6 using xhci_hcd
[ 1392.619364] usb 2-2: New USB device found, idVendor=152d, idProduct=0539
[ 1392.619369] usb 2-2: New USB device strings: Mfr=10, Product=11, SerialNumber=3
[ 1392.619371] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1392.619373] usb 2-2: Manufacturer: JMicron
[ 1392.619375] usb 2-2: SerialNumber: 00A123457372
[ 1392.620649] scsi host8: uas
[ 1392.622059] scsi 8:0:0:0: Direct-Access JMicron 0125 PQ: 0 ANSI: 6
[ 1392.624369] sd 8:0:0:0: Attached scsi generic sg1 type 0
[ 1392.625933] sd 8:0:0:0: [sdb] 500118192 512-byte logical blocks: (256 GB/238 GiB)
@rektide
rektide / gist:ee1ead10f0704c4ab470
Created January 8, 2015 08:40
apt_preferences late-night glitchorama
The only thing that changes is Package: goes from iceweasel to *.
broken:
Package: iceweasel
Pin: origin mozilla.debian.net
Pin-Priority: 600
$ apt-cache policy iceweasel
Version table:
35.0~b3-1 600
@rektide
rektide / gist:8dd860fdfde89dcc3c5f
Created December 25, 2014 05:00
ANSIBLE, WHY?!
TASK: [file path="{{SYSTEMD_UNIT_DIR}}" state=directory] **********************
<127.0.0.1> REMOTE_MODULE file path="~/.config/systemd/user" state=directory
changed: [127.0.0.1] => {"changed": true, "gid": 1000, "group": "rektide", "mode": "0755", "owner": "rektide", "path": "/home/rektide/.config/systemd/user", "size": 0, "state": "directory", "uid": 1000}
TASK: [template src="files/{{target}}/{{target}}.{{unit_type}}" dest="{{dest}}"] ***
skipping: [127.0.0.1]
TASK: [template src="files/systemd.{{unit_type}}" dest="{{dest}}"] ************
failed: [127.0.0.1] => {"failed": true, "path": "/home/rektide/.config/systemd/user/synergy-main.service", "state": "absent"}
msg: file (/home/rektide/.config/systemd/user/synergy-main.service) is absent, cannot continue
@rektide
rektide / undirectional-principles.md
Last active August 29, 2015 14:11
Principles & Practices downstream of Unidirectional-Data-Flow

Unidirectional Data-Flow is an implementation design. Views map store's state (edge triggered) into a view. The view creates actions. Actions update the store. This fufills:

  1. Functional Reactive Programming (#FRP): the view is a function over the stores, and is called as the stores update, producing DOM output.
  2. Command-Query Responsibility Separation (#CQRS): actions are commands changing the centralized states, the view is a query on the state.
  3. Event-Sourcing (#ES): actions are themselves transmitted states asserted into a dispatcher, which can maintain the log, thereby enabling an undo-redo. In practice, often the retained log is the list of states instead of list of events (as bijectional events are hard to get right), but it enables ES's chief win: programmatic access to the sequence of computation.

This is the first time I'd say web-dev is anywhere close to getting it right. Everything else has been an experiment, until now: this is the first total-ordering I've seen for how web

@rektide
rektide / gist:bb6cec805fe73ae3875c
Last active August 29, 2015 14:10
bottom-up-vs-top-down-engineering

My feedback from the perspective of a framework developer is quite different. I found the tone and attitude towards express.js to be concerning and somewhat offensive. Here was a developer blaming the framework he chose for poor architecture when they never bothered to actually learn how the framework works in the first place. Everything that followed originated from this basic lack of understanding.

Express is designed with from a classic framework-developer perspective, exposing primarily a 'consumption-only' that allows developers to assemble together complex routing structures.

Express uses a very simple router logic which is at the core of how express works, so let’s examine that first (my knowledge of express is somewhat dated but I think the principal is still the same). Express keeps a hash of the various HTTP methods (GET, POST, etc.) and for each method, an array of middlewares. Each middleware is just a function with signature function(req, res, next) and an regular expression used to decid

// ==UserScript==
// @name monkeybusiness-codeschool
// @namespace https://github.com/johnelliott/monkeybusiness
// @include http://*.codeschool.com/*
// ==/UserScript==
// this is not actually a UserScript. because `getEventListeners` only exists in the dev-consoles.
// so copy paste this content in rather than actually running it as a userscript
// the capability not actually in HTML.
@rektide
rektide / info.end.json
Created November 12, 2014 16:30
status report - a happy ending, new beginnings
{
"month": "11",
"num": 1446,
"link": "http:\/\/xkcd1446.org\/",
"year": "2014",
"news": "",
"safe_title": "Landing",
"transcript": "...",
"status": {
"rosetta": "in space",
@rektide
rektide / mvn.log
Created October 19, 2014 18:18
Deriving from Netty-parent
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.classifier: linux-x86_64
---------------------------------------------------
constituent[0]: file:/usr/share/maven/lib/wagon-http-shaded.jar
constituent[1]: file:/usr/share/maven/lib/plexus-interpolation.jar