Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
e'rry day I'm hustlin'

Ændrew Rininsland aendrew

:shipit:
e'rry day I'm hustlin'
View GitHub Profile
@1wheel
1wheel / README.md
Created Jan 21, 2017
ndjson-to-file
View README.md

Trying to save a big blob of JSON that crashes JSON.stringify. Spliting into smaller arrays and saving works, but I can't figure out how to use a stream.

View please-include-a-repro.md

Please include a repro

You probably arrived here because of a curt message in response to an issue you filed on a repo that I contribute to. Sorry about that (particularly if you filed the issue long ago and have been waiting patiently for a response). Let me explain:

I work on a lot of different open source projects. I really do like building software that makes other people's lives easier, but it's crazy time-consuming. One of the most time-consuming parts is responding to issues. A lot of OSS maintainers will bend over backwards to try and understand your specific problem and diagnose it, to the point of setting up new test projects, fussing around with different Node versions, reading the documentation for build tools that we don't use, debugging problems in third party dependencies that appear to be involved in the problem... and so on. I've personally spent hundreds of hours of my free time doing these sorts of things to try and help people out, because I want to be a responsible maintainer and I

@JonCole
JonCole / WhatHappenedToMyDataInRedis.md
Last active Oct 28, 2019
What happened to my data in Redis?
View WhatHappenedToMyDataInRedis.md
@VandeurenGlenn
VandeurenGlenn / app.js
Created Dec 26, 2015
webcomponents feature detection
View app.js
(function(document) {
'use strict';
// Feature detection
// Check if Web Components are supported
var webComponentsSupported = ('registerElement' in document
&& 'import' in document.createElement('link')
&& 'content' in document.createElement('template'));
// Load Web Components when not supported
if (!webComponentsSupported) {
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active Oct 23, 2020
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
View ultimate-ut-cheat-sheet.md
@StephanHoyer
StephanHoyer / github.js
Last active Sep 23, 2020
Commiting multiple files to github over API
View github.js
'use strict';
var Octokat = require('octokat');
var extend = require('lodash/object/assign');
var defaults = {
branchName: 'master',
token: '',
username: '',
reponame: ''
View webpack.config.js
/* Load Zepto as module */
module.exports = {
entry: "./app.js",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /zepto(\.min)?\.js$/, loader: "exports?Zepto; delete window.$; delete window.Zepto;" },
@robhudson
robhudson / gist:3848832
Last active Jul 12, 2018
Quick way to set CORS headers on django-tastypie resources
View gist:3848832
class CORSResource(object):
"""
Adds CORS headers to resources that subclass this.
"""
def create_response(self, *args, **kwargs):
response = super(CORSResource, self).create_response(*args, **kwargs)
response['Access-Control-Allow-Origin'] = '*'
response['Access-Control-Allow-Headers'] = 'Content-Type'
return response
@jarek-foksa
jarek-foksa / gist:2648095
Last active Apr 26, 2020
SVGElement.prototype.innerHTML shim
View gist:2648095
// Important: You must serve your pages as XHTML for this shim to work,
// otherwise namespaced attributes and elements will get messed up.
Object.defineProperty(SVGElement.prototype, 'innerHTML', {
get: function() {
var $child, $node, $temp, _i, _len, _ref;
$temp = document.createElement('div');
$node = this.cloneNode(true);
_ref = $node.children;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
$child = _ref[_i];
@nrabinowitz
nrabinowitz / fitProjection.js
Created Feb 7, 2012
D3 function for fitting a projection to geodata
View fitProjection.js
function fitProjection(projection, data, box, center) {
// get the bounding box for the data - might be more efficient approaches
var left = Infinity,
bottom = -Infinity,
right = -Infinity,
top = Infinity;
// reset projection
projection
.scale(1)
.translate([0, 0]);
You can’t perform that action at this time.