Skip to content

Instantly share code, notes, and snippets.

View kadamwhite's full-sized avatar

K Adam White kadamwhite

View GitHub Profile
@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
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 10, 2025 09:21
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

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>
@branneman
branneman / better-nodejs-require-paths.md
Last active April 11, 2025 10:39
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

@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
@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();
@moebio
moebio / gist:5601071
Last active December 17, 2015 11:19
list of references of my talk at http://openvisconf.com
@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:

@gnarf
gnarf / ..git-pr.md
Last active January 27, 2025 01:56
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
1. Site files in www/mynewsite
2. SQL dump (if needed) in database/backups/database_name.sql
3. CREATE DATABASE and GRANT PRIVILEGES statements for new DB name in database/init-custom.sql
4. nginx config at /config/nginx-config/sites/my.site.name.conf
5. nginx config should have a unique server name and point to the www/mynewsite directory
6. vagrant reload
7. edit hosts file to point 192.168.50.4 to my.site.name