Skip to content

Instantly share code, notes, and snippets.

View bradoyler's full-sized avatar
👋
say hi

brad oyler bradoyler

👋
say hi
View GitHub Profile
@ivan-kleshnin
ivan-kleshnin / lwip.utils.js
Last active August 29, 2015 14:12
Resize with lwip
// resolution is [width, height] structure
// Evaluate resolution by width (height doesn't matter, just keep it proportional)
function evalResolutionByWidth(requiredWidth, actualResolution) {
var actualWidth = actualResolution[0];
var actualHeight = actualResolution[1];
if (actualWidth > requiredWidth) {
var scale = actualWidth / requiredWidth;
return [requiredWidth, Math.round(actualHeight / scale)];
} else {
@tomcardoso
tomcardoso / heroku.sh
Last active March 28, 2016 17:59
chart tool heroku deployment
#!/bin/bash
CURRHASH=`git rev-parse --short HEAD`
CURRBRANCH=`git rev-parse --abbrev-ref HEAD`
git commit -am "Deploying ${CURRHASH} to Heroku"
git checkout -b "deploy-${CURRHASH}"
gulp lib-build
@Hypercubed
Hypercubed / README.md
Last active June 15, 2016 20:47
Epicyclic Gearing (with svgsaver)

From Wikipedia:

Epicyclic gearing or planetary gearing is a gear system consisting of one or more outer gears, or planet gears, revolving about a central, or sun gear. … Epicyclic gearing systems also incorporate the use of an outer ring gear or annulus, which meshes with the planet gears.

Use the menu in the top-left to change the frame of reference, fixing the specified gear in-place.

forked from mbostock's block: Epicyclic Gearing

@bradoyler
bradoyler / node-standards-v4.md
Last active April 27, 2017 14:17
Node.js Standards (for the enterprise) we should all try to agree on.

Some NodeJs (v4.x) choices we can all agree on?

@plmrry
plmrry / .block
Last active May 17, 2017 14:15
Collision Radius Transition
license: gpl-3.0
@aendra-rininsland
aendra-rininsland / GoT-screentimes--s06.json
Last active September 7, 2017 13:33
Game Of Thrones total screentimes (Up to and including Season 6)
[
{
"name": "Tyrion Lannister",
"imdbUrl": "http://www.imdb.com/character/ch0146096/",
"screentime": 293.3,
"episodes": 54,
"portrayedBy": {
"name": "Peter Dinklage",
"imdbUrl": "http://www.imdb.com/name/nm0227759/"
}
@mbostock
mbostock / .block
Last active September 26, 2018 01:31
Projected TopoJSON
license: gpl-3.0
height: 800
@markselby
markselby / node-express-redis-cache.js
Created October 28, 2013 02:19
Add Redis request caching to Node.js with Express.js.
var zlib = require('zlib');
var redis = require('redis');
var redisClient = redis.createClient();
var crypto = require('crypto');
// Our custom caching write function
function cached(body, lifetime, type) {
var key = this.req.originalUrl;
var res = this;
var etag, len;
@rveciana
rveciana / README.md
Last active May 15, 2019 15:36
Congressional representatives dataset

Based on this data, contains a Shapefile and two topojson with the US congressional Districts.

The atlas-make project has a better maintained version of this data.

The difference from the data is based on, is that the American Samoa, Guam and Northern Marianas are included from the Natural Earth dataset. The Congress Representative data is included too.

get_areas.py is a script to calculate the area paoperties for the new objects. The name of the Congressional Representatives in the added territories has been taken from the Wikipedia.

The topojson has been calculated using the command: topojson -o us_congressional_district.json cgd114p010g.shp -p

@cmgiven
cmgiven / .block
Created August 15, 2016 16:11
Demers Cartogram
license: mit
height: 600