Skip to content

Instantly share code, notes, and snippets.

@calvinf
calvinf / install-apparix.sh
Last active September 13, 2016 21:33 — forked from glombard/install-apparix.sh
Setting up Apparix for directory bookmarks on Mac OS X
brew install -v apparix
# Installed to: /opt/foo/Cellar/apparix/11-0/bin/apparix
# Add bm/to Bash functions from man page to .bashrc or .local.bash:
man -P cat apparix | awk '/BASH-style functions/{p=1} /---/{if(p==1)p=2; else p=0; next} p>1{print}' >> ~/.bash_profile
# Reload my bash config:
source ~/.bash_profile
# Now create a bookmark:
@calvinf
calvinf / Enhance.js
Created November 10, 2015 04:22 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@calvinf
calvinf / HighlightCode.md
Last active August 29, 2015 13:57 — forked from jimbojsb/gist:1630790
Highlight code for inclusion on slide in Keynote

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

JavaScript Testing with Grunt, Mocha and Chai

In the following post I would like to introduce one way how you can setup your testing workflow for JavaScript development. The central components in the testing environment are Grunt, Mocha and Chai that I will cover from the introduction and installation of each component to the cooperation of all components for the execution of tests.

If you are already an experienced Grunt user and just look for the Gruntfile.js and the Mocha / Chai setup just skip the central components section and skip to the installing components part.

You can find the sample project with all code at GitHub on: https://github.com/maicki/sample-js-testing-grunt-mocha-chai

Central Components

@calvinf
calvinf / pre-push.py
Created September 4, 2013 20:51 — forked from co3k/pre-push.py
#!/usr/bin/env python
import sys, os
info = sys.stdin.read().strip().split(" ")
range = ""
if info:
range = "{}..{}".format(info[3], info[1])
sys.stdin = open('/dev/tty')
@calvinf
calvinf / pr.md
Created March 25, 2013 18:47 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@calvinf
calvinf / mobile-meta-links.html
Created March 31, 2012 00:55
iOS Web App Configuration