Skip to content

Instantly share code, notes, and snippets.

View jfsiii's full-sized avatar

John Schulz jfsiii

View GitHub Profile
@yocontra
yocontra / LazyLoad.js
Created December 2, 2014 01:23
lazy loading react components, useful for video/audio/etc
var React = require('react');
var events = require('add-event-listener');
var isVisible = require('../isVisible');
var LazyLoad = React.createClass({
displayName: 'LazyLoad',
propTypes: {
distance: React.PropTypes.number,
component: React.PropTypes.node.isRequired,
children: React.PropTypes.node.isRequired
@dgraham
dgraham / fetch.js
Last active March 24, 2023 15:44
Simple window.fetch wrapper.
(function() {
function status(response) {
if (response.ok) {
return response
} else {
var error = new Error(response.statusText || response.status)
error.response = response
throw error
}
}
@staltz
staltz / introrx.md
Last active April 6, 2025 09:15
The introduction to Reactive Programming you've been missing
(function() {
'use strict';
var indexOf = function(list, needle) {
if (list.indexOf) return list.indexOf(needle);
for (var i = 0, n = list.length; i < n; i++) {
if (list[i] === needle) return i;
}
return -1;
};
@hoverbird
hoverbird / rpg_attributes_by_popularity.json
Last active September 10, 2019 14:11
Tabletop RPG character analysis! The first document is a mapping of game systems to the character attributes they use. The second document shows these attributes and the number of games that use them. The most popular attributes should be familiar to all role-players: Strength, Dexterity, Intelligence, Agility, Charisma, Constitution and Percept…
[["Strength",313],["Dexterity",202],["Intelligence",198],["Agility",133],["Charisma",127],["Constitution",114],["Perception",91],["Stamina",68],["Willpower",62],["Speed",54],["Body",54],["Endurance",51],["Appearance",51],["Presence",50],["Luck",49],["Mind",48],["Will",47],["Wits",42],["Wisdom",34],["Brains",32],["Coordination",32],["Manipulation",31],["Awareness",31],["[no standard attributes]",31],["Reflexes",30],["Intellect",28],["Health",28],["Knowledge",27],["Soul",24],["Fitness",23],["Reasoning",22],["Power",22],["Intuition",20],["Size",19],["Looks",19],["Spirit",18],["Resolve",18],["Ego",18],["Comeliness",17],["Physical Strength",16],["Physique",16],["Influence",15],["Personality",14],["Charm",14],["Craftiness",14],["Intelligence Quotient",13],["Physical Beauty",13],["Toughness",13],["Cool",13],["Education",12],["Creativity",12],["Mental Endurance",12],["Mental Affinity",12],["Physical Prowess",12],["Physical Endurance",12],["Vigor",11],["Brawn",11],["Piety",11],["Body Pips",11],["Composure",11],["Quick
@mbostock
mbostock / .block
Last active March 10, 2025 09:49
Wrapping Long Labels
license: gpl-3.0
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 27, 2025 16:31
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@pmeenan
pmeenan / user-timing-rum.js
Last active January 18, 2024 23:46
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@jhs
jhs / example.js
Created December 10, 2012 03:16
My Node.js modules these days
// Short module explanation // Something to gather my thoughts
// // I think this looks cool.
//
module.exports = the_exported_function // Modules are a function. Always.
//
module.exports.extra = extra // Additional API entry points if
module.exports.other = other // desired.
//
var util = require('util') // Other packages from npm or core
var assert = require('assert') // No comma-first due to lots of
@wilmoore
wilmoore / readme.md
Last active December 28, 2021 20:06
Git :: Personal Git Configuration