Skip to content

Instantly share code, notes, and snippets.


Rob Dunham Nilpo

View GitHub Profile
View conditionally-load-jquery.js
// Conditionally Load jQuery (javascript)
// Source:
var init, loadjQuery;
init = function() {
jQuery(document).ready(function() {
alert('Your Code Here');
View .bashrc
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
View gh_hook.php
* This file serves as a post receive hook for a GitHub repository. It should be placed in the root of the repository.
* To begin, you will need to store a secret key in an environmental variable on the server.
* export SECRET_TOKEN=your_token

Creating a Happy Git Environment on OS X

Step 1: Install Git

Configure things:

git config --global "Your Name"
git config --global ""
git config --global checkout
git config --global apply.whitespace nowarn
View boilerplate.textile

<< Project Name >>

<< Project description >>

Branch structure for submodules

There are two branches to this repository, master and production, these make it easier to use the same repository for developing as well as for sharing the code as a Git submodule.

The master Branch

View modernscale.css
body {
font-size: 100%;
body, caption, th, td, input, textarea, select, option, legend, fieldset, h1, h2, h3, h4, h5, h6 {
font-size-adjust: 0.5;
#page {
font-size: 1em;
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

Nilpo / luhn.js
Last active Aug 29, 2015 — forked from ShirtlessKirk/luhn.js
Luhn validation algorithm
View luhn.js
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (
var luhnChk = (function (arr) {
return function (ccNum) {
len = ccNum.length,
bit = 1,
Nilpo /
Last active Sep 4, 2015 — forked from bgrins/
Prevent errors on console methods when no console present and expose a global 'log' function.

Javascript log Function

Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.

There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.

This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:

  • The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,
Nilpo / call-apply-bind-proxy.js
Last active Sep 16, 2015 — forked from branneman/call-apply-bind-proxy.js
JavaScript call() vs apply() vs bind() vs $.proxy()
View call-apply-bind-proxy.js
var fn = function(arg1, arg2) {
var str = '<p>aap ' + this.noot + ' ' + arg1 + ' ' + arg2 + '</p>';
document.body.innerHTML += str;
var context = {
'noot': 'noot'
var args = ['mies', 'wim'];
// Calls a function with a given 'this' value and arguments provided individually.
You can’t perform that action at this time.