Skip to content

Instantly share code, notes, and snippets.

function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
@DaxChen
DaxChen / osx-for-hackers.sh
Created December 20, 2016 04:55 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@DaxChen
DaxChen / gist:f7d9fc5684ad75505c25
Created March 28, 2016 03:59
Cropping an image client-side using the Canvas
// From README of: https://github.com/DominicTobias/react-image-crop
loadImage: function(src, callback) {
var image = new Image();
image.onload = function(e) {
callback(image);
image = null;
};
image.src = src;
@DaxChen
DaxChen / meteor-react-scaffold
Created October 25, 2015 00:57
My personal Meteor scaffold script for React apps
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <project name>" >&2
exit 1
fi
meteor create $1
rm -f $1/$1*
mkdir -p $1/client/components $1/client/pages $1/client/lib $1/client/styles $1/server $1/lib/collections $1/public $1/tests/cucumber/features/step_definitions $1/tests/cucumber/fixtures $1/tests/cucumber/features/support