Skip to content

Instantly share code, notes, and snippets.

View kadamwhite's full-sized avatar

K Adam White kadamwhite

View GitHub Profile
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@darrentorpey
darrentorpey / underscore_primer.md
Last active September 11, 2017 16:19
An underscore.js primer

An Underscore.js Primer

Written by Darren Torpey and presented to Rue La La in May 2013.

This guide was written based upon Underscore.js version 1.4.4.

What is Underscore.js? How does it help us?

From the official website:

@moebio
moebio / gist:5601071
Last active December 17, 2015 11:19
list of references of my talk at http://openvisconf.com
@oconnore
oconnore / event_mixin.js
Created July 30, 2013 21:43
Backbone style events
(function(exports) {
'use strict';
/*
activecontexts is a two level map
Map(object -> Map(context -> true))
The second map is simply used for efficient set lookup (has)
*/
var activecontexts = new WeakMap();
@cowboy
cowboy / questions.json
Last active December 23, 2015 00:09
grunt-init y/n question helper.
[
{
"name": "yes",
"message": "This question will default to yes (true).",
"default": true
},
{
"name": "no",
"message": "This question will default to no (false).",
"default": false
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

A future version of Ember will come with a new templating engine known as HTMLBars.

The original motivation for HTMLBars was to allow helpers and properties to have better contextual information about what they were bound to.

So for example, consider a template like this:

<a href="{{url}}">{{link}}</a>
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@GaryJones
GaryJones / .csscomb.json
Last active November 2, 2018 19:49
[Replaced] CSSComb file for WP core.
See https://github.com/cedaro/grunt-wp-css/blob/develop/tasks/config/default.json
int gap = 20;
void setup() {
size(1000, 1000);
strokeWeight(4);
strokeCap(SQUARE);
frameRate(0.5);
}
void draw() {