Skip to content

Instantly share code, notes, and snippets.

View yoshuawuyts's full-sized avatar

Yosh yoshuawuyts

View GitHub Profile
@funzoneq
funzoneq / gist:973d6a90eb93f3c9c947
Created July 3, 2014 14:12
22tracks playlists with a sonos queue
#!/usr/bin/env python
import soco
import requests
from pprint import pprint
playlistnr = 20
path = 128
def get_playlist(playlistnr):
pl = requests.get("http://22tracks.com/api/tracks/%s" % playlistnr)
@max-mapper
max-mapper / index.js
Last active August 29, 2015 14:06
node tcp + http speed test
var net = require('net')
var through = require('through2')
var server = process.argv[2]
var path = process.argv[3]
var host = process.argv[4]
var socket = net.connect(80, server)
var req = ["GET " + path + " HTTP/1.1\r\n",
╔═════╗ ╔════════════╗ ╔════════╗ ╔═════════════════╗
║ API ║<──────>║ Middleware ║──────>║ Stores ║──────>║ View Components ║
╚═════╝ ╚════════════╝ ╚════════╝ ╚═════════════════╝
^ │
│ │
╔════════════╗ │
║ Dispatcher ║ │
╚════════════╝ │
^ │
└────────────────────────────────────────┘

vanilla react tooling

This is an overview of what tools I use to build React applications in pure JavaScript. The relation between modules can best be mapped like this:

╔═════╗        ╔═════╗       ╔══════════════╗       ╔═══════╗
║ API ║<──────>║ Fax ║──────>║ Simple-store ║──────>║ React ║
╚═════╝        ╚═════╝       ╚══════════════╝       ╚═══════╝
                  ^                                     │
                  │                                     │
             ╔══════════╗                               │
 ║ Barracks ║ │
@termie
termie / gist:216ccdfd87c54bd39aa6
Created January 20, 2015 09:52
auto-color based on directory
# add this to your .zshrc and then add
# $(__prompt_color) to your PROMPT
function __prompt_color()
{
local RGB CONVERTED RH GH BH RD GD BD
RGB=$(echo $(pwd) | md5 | cut -c 1-6)
RH=$(echo ${RGB} | cut -c 1-2)
GH=$(echo ${RGB} | cut -c 3-4)
// run maps to lazy multistream
var execspawn = require('npm-execspawn')
var duplexify = require('duplexify')
var multistream = require('multistream')
var parallel = require('parallel-multistream')
var pumpify = require('pumpify')
var duplexify = require('duplexify')
var toStream = function(cmd) {
@mattdesl
mattdesl / readme.md
Last active August 29, 2015 14:20
scoped packages tip

Typical process:

  • fork a repo
  • make your patch
  • send PR

Sometimes its a long wait, and in the mean time you end up depending on Git (bad for semver/persistence, slow installs, etc).

public scoped packages

@timoxley
timoxley / gist:ae19556a33dd3867a697
Last active August 29, 2015 14:20
tl;dr. 2.5 Dynamic Behavior Changes: Changing An Instance’s Class and Dynamic Inheritance

Organizing Programs Without Classes

Source: https://cs.au.dk/~hosc/local/LaSC-4-3-pp223-242.pdf

Section 2.5 Dynamic Behavior Changes: Changing An Instance’s Class and Dynamic Inheritance

tl;dr

Sometimes the behavior of an instance of a data type can be divided into several different “modes” of behavior or implementation…

arch

The goal is to get arch linux on a 2014 MBP Retina. We don't pretend to know what we're doing, so the goal is to aui in as few steps as possible so we don't have to configure the system ourselves.

create boot disk

# download iso first from https://www.archlinux.org/download/
$ hdiutil convert -format UDRW -o destination_file.img source_file.iso
@yoshuawuyts
yoshuawuyts / frp.md
Last active August 29, 2015 14:22 — forked from ohanhi/frp.md

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Foreword