Skip to content

Instantly share code, notes, and snippets.

@calvinf
calvinf / sublime-packages.md
Last active September 11, 2015 17:59
Sublime Text Packages
@calvinf
calvinf / .gitconfig
Last active April 4, 2017 15:45
Git config
[alias]
br = branch
co = checkout
pr = pull --rebase
st = status
vimdiff = difftool -y -t vimdiff
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
graph = log --branches --pretty=short --decorate --graph
branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
dag = log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)\"%an\" <%ae>%C(reset) %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)%n%s' --date-order
@calvinf
calvinf / js-testing-playground.html
Created July 19, 2015 02:40
JavaScript Testing Playground (Mocha, Chai, and $script)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript Testing Playground</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/mocha/2.2.5/mocha.min.css" rel="stylesheet" />
<style>
*, *:before, *:after {
@calvinf
calvinf / verse-example-reactjs.html
Created February 7, 2015 06:40
Bible Verse Example App (React.js)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bible Verse Example (React.js)</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css" />
@calvinf
calvinf / TestingTools.md
Last active August 29, 2015 14:04
Testing Tools

Testing Tools

Java

It's a language. Oracle owns it, and it works well for many things.

Unit testing. The original Java unit testing tool. It's pretty great.

Great for mocking classes.

@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 / .tmux.conf
Last active June 2, 2017 01:40
Tmux Configuration
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# Copy mode stuff
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'x' copy-selection
bind-key 'p' run-shell "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
bind-key 'y' send-keys x\; run-shell "tmux save-buffer - | reattach-to-user-namespace pbcopy"\; display-message "copied"
@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 = git@github.com: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: