Skip to content

Instantly share code, notes, and snippets.

View rdmurphy's full-sized avatar
🔴
Red pandas are the best.

Ryan Murphy rdmurphy

🔴
Red pandas are the best.
View GitHub Profile
@jeremyjbowers
jeremyjbowers / veggie_stock.md
Last active January 2, 2016 08:19
Veggie ramen broth. Because sometimes, just sometimes, you need to feed a vegan who suffers from Celiac disease.

Veggie Stock for Ramen

This is a two-part stock. It starts as an umami-heavy kombu/mushroom dashi and then adds a vegetable backbone. Intended to mimic the "two-broth" style of non-vegetarian ramen stock.

Ingredients

Dashi

Note these are estimates. You can vary by more than double without ruining anything.

  • 1 medium package (3-4 oz) of dried mushrooms
  • 3 sheets of kombu kelp

Vegetables

@rnagle
rnagle / ChartView.js
Created March 7, 2014 19:17
ChartView.js
/**
* Original author: David Eads (https://github.com/eads)
*
* Wrap D3 charting components in a simple Backbone view interface
*
* Provides a redrawing path, data sync, and fallback for non-d3 browsers.
*
* Views that extend ChartView should implement their own "draw" function and go to work.
*
* var collection = new Backbone.Collection([ ["Maria", 33], ["Heather", 29] ]);
@julianshapiro
julianshapiro / RAF.js
Last active May 11, 2024 15:21
requestAnimationFrame Polyfill
var requestAnimationFrame = window.requestAnimationFrame || (function() {
var timeLast = 0;
return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
var timeCurrent = (new Date()).getTime(),
timeDelta;
/* Dynamically set the delay on a per-tick basis to more closely match 60fps. */
/* Technique by Erik Moller. MIT license: https://gist.github.com/paulirish/1579671. */
timeDelta = Math.max(0, 16 - (timeCurrent - timeLast));
@donohoe
donohoe / index.html
Created April 15, 2014 22:39
Super simple basic hacky NYTimes API that hooks into their JSONP feeds
<html>
<head>
<title>Super Simple Sandbox</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<script src="nyt.js"></script>
</body>
</html>
@dbrgn
dbrgn / mixins.py
Last active September 13, 2018 20:44
Moved to https://github.com/dbrgn/drf-dynamic-fields
@addyosmani
addyosmani / package.json
Last active December 28, 2024 12:07
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@dgowrie
dgowrie / revealing-prototype-pattern.js
Last active December 18, 2015 17:40
Public / private members on a "class" via the Pseudoclassical pattern using Prototypal Inheritance combined with the Revealing Module pattern - AKA a "revealing prototype pattern"
// constructor
function Person(name) {
this.name = name;
// etc... but no methods here
}
// prototype for all methods, using an IIFE with a returned object for 'public' methods
Person.prototype = (function() {
var parseCSV = require("./parse-csv.js");
// Call the function, pass a callback as the second arg
parseCSV("data.csv",function(err,rows){
// Did something go wrong?
if (err) {
throw new Error(err);
}
@paulirish
paulirish / what-forces-layout.md
Last active May 16, 2025 01:11
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@dgowrie
dgowrie / prototype-pattern.js
Created October 4, 2015 06:44
Yet another iteration of (revealing)Prototype Pattern with private/public methods
var myPrototypeModule = (function() {
'use strict';
var privateVar = 'Alex Castrounis',
count = 0;
function PrototypeModule(name) {
this.name = name;
}
function privateFunction() {