Skip to content

Instantly share code, notes, and snippets.

View phated's full-sized avatar
💰
Sponsor my open source work! https://github.com/sponsors/phated

Blaine Bublitz phated

💰
Sponsor my open source work! https://github.com/sponsors/phated
View GitHub Profile
@phated
phated / styles.css
Created September 4, 2016 06:30 — forked from pburtchaell/styles.css
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@phated
phated / 01-fractal-weird-design.md
Created July 23, 2016 00:01 — forked from spion/01-fractal-weird-design.md
Node streams - a fractal of weird design

Node streams - a fractal of weird design

and a potential refactor that could fix that

This is a list of issues and confusions I've encountered with node streams, and things I wish were designed and implemented differently. If promise-streams is ever going to change to a design that doesn't build on top of node streams, this would be a list of mistakes to avoid

  1. enc parameter - Why is encoding always passed together with the data? It should be a separate concern. It doesn't even make sense in objectMode
  2. eventemitter base - There is no reason to use an uncomposable grab-bag of stringy events as a base
  3. relying on nextTick etc for execution order - This is very unreliable and causes all sorts of unpredictable rules for implementers which are not documented anywhere.
  4. no error propagation
@phated
phated / Quimby.md
Last active August 29, 2015 14:11 — forked from jasonpincin/Quimby.md

Quimby

Quimby is Walmart's service layer for mobile clients' configuration, CMS, a-b testing setup, and a few other sundry related services. It stitches together a constellation of data sources into a concise menu of API calls that mobile clients make to intialize and configure themselves.

Quimby is a REST service layer based upon the Gogo micro-service framework that we in turn built with Node.js, Hapi, Zookeeper, and Redis. Gogo is able to expose an array of web servers as a single host, and offers the ability to isolate tasks into smaller focused processes, emphasizing scalability and failure recovery. For example, a failure in any micro-service will not affect the life cycle of a request. Gogo also offers the additional features required to build distributed services with shared state, such as leader election.

Quimby components

  • Penny (part of Gogo) - The micro-service router, responsible for pairing a request with a servicer
var node = require('when/node');
var net = require('net');
var RedisClient = require('redis').RedisClient;
var host = '127.0.0.1';
var port = 6379;
var commands = require('redis/lib/commands');
function PromisedRedisClient() {
RedisClient.apply(this, arguments);
}
2014-01-08 09:48:39 substack https://gist.github.com/substack/8313379
2014-01-08 09:48:39 substack Raynos: ^^^
2014-01-08 09:48:39 substack a task automation framework to go along with your http framework
2014-01-08 09:48:39 guybrush i knew you are into build-systems now there is the proof
2014-01-08 09:48:39 phated substack: are you an idiot by choice or do you just ignore everything that doesn't come from your own head?
2014-01-08 09:48:39 Raynos substack: :D
2014-01-08 09:48:39 Raynos substack: nice!
2014-01-08 09:48:39 substack phated: I can't understand why people don't just use bash or makefiles or write little scripts
2014-01-08 09:48:39 Raynos That is really good
2014-01-08 09:48:39 Raynos It's actually really good