Skip to content

Instantly share code, notes, and snippets.

View dylanvee's full-sized avatar

Dylan Vassallo dylanvee

  • San Francisco, CA
  • 20:26 (UTC -08:00)
View GitHub Profile
@andymatuschak
andymatuschak / States-v3.md
Last active November 14, 2024 18:33
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

#!/usr/bin/env python2.7
try:
import simplejson as json
except ImportError:
import json
import tempfile
import sqlite3
import subprocess
@jsdf
jsdf / ReactNativeFaye.js
Created March 31, 2015 10:06
Use Faye pubsub with React Native
// make sure you npm install 'url' (the browserify port of the node api url module)
var url = require('url')
var Faye = require('faye/browser/faye-browser')
var API_URL = 'http://localhost:8000/faye'
// initialise fake window.location - same origin as api host
// required to use some faye transports which expect to deal with same-origin policy.
// url.parse return value looks kind of like window.location, if you squint just right
window.location = url.parse(API_URL)
@jewelia
jewelia / gist:0b8f26e91f2818bef460
Last active August 29, 2015 14:15
3 Great Engineering Management Talks from 2014

General key themes:

  • Hiring is really hard. You’re not just hiring a “Rails Engineer” or a “Python Programmer” you’re hiring someone who can help you change the world. Tell them why! Talk about the hard problems you’re solving. 2/3 of these talks give ideas and insight into hiring from sourcing to actual interview processes.

  • Rewriting systems is hard. People think they are going to replace their broken down horse and buggie with a bullet train and this often ends up in disaster. Successful rewrites require an incremental approach that takes months/years and often runs way over schedule. 2/3 of these talks go over how to handle rewrites not only from a high level technical perspective but a cultural/management perspective as well.

Two Developers, Many Lines of Code, and A Campaign that Made History

Harper Reed (CTO of Obama for America, now CEO of Modest) and Dylan Richard (Director of Eng of Obama for America, now CTO of Modest)

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@MattFaus
MattFaus / appengine_config.py
Last active August 3, 2018 12:28
All of the code necessary to implement and test protobuf projection in a Google Appengine web application.
import db_util
db_util.enable_db_protobuf_projection()
db_util.enable_ndb_protobuf_projection()
@Mikayex
Mikayex / README.md
Last active March 19, 2016 17:06
Patch to add sequential downloading option to Transmission
@staltz
staltz / introrx.md
Last active November 19, 2024 02:40
The introduction to Reactive Programming you've been missing
@marcia
marcia / gist:7018719
Last active December 25, 2015 18:09
Implementing color palettes with LESS mixins
// List out each domain's colors theme
@mathDomainColor: #297395; // The dark blue
@mathSubjectColor: #30a7de; // The lighter blue
... more colors ...
@scienceDomainColor: #ba3d66; // The dark pink
@scienceSubjectColor: #c8547c; // The lighter pink
... more colors ...
// Here's a mixin that will call .domainRuleToApply on each domain for us
void
_wrap_add_torrent_params_name_get(void *swig_v)
{
libtorrent::add_torrent_params *arg1 = (libtorrent::add_torrent_params *) 0 ;
std::string *result = 0 ;
struct swigargs {
libtorrent::add_torrent_params *arg1;
long : 0;
_gostring_ result;