Skip to content

Instantly share code, notes, and snippets.

@chatrjr
chatrjr / node-manager.sh
Created December 13, 2013 15:48
Probably overcomplicated, but I wanted to try my hand at creating a procedural script.
# !/bin/bash
# A Bash script to download and install Nodejs updates
init() {
echo "Welcome to my simple script to install (from stable source) and update Node.js on Ubuntu distros."
echo "'Cause that's a pain in the ass."
echo "Yeah, yeah. Chris Lea's PPA would be even easier."
echo "This just makes it easy to have a custom install. No muss. No fuss. Let's begin."
helper_separator
setup
@chatrjr
chatrjr / footer.php
Created December 17, 2012 11:45
Quick WordPress Conversion Tutorial
@chatrjr
chatrjr / lazy-dev2-example3.js
Created December 12, 2012 19:55
Luhn formula multi-step testing example
describe('Luhn Formula Example', function () {
// Final test at the top
it('should validate IDs according to the Luhn formula', function () {
expect(validateID('120488395')).to.be.ok();
});
// 1. Convert a string of numbers to an integer
@chatrjr
chatrjr / lazy-dev2-example2.js
Created December 7, 2012 02:45
Implementation of the first test.
function add (x, y) {
return x + y;
}
@chatrjr
chatrjr / lazy-dev2-example1.js
Created December 7, 2012 01:27
An example of a simple unit test written with Mocha and expect.js.
var expect = require("expect.js");
describe('A simple unit test', function () {
it('should add two integers and return the sum', function () {
// implementation to go here
expect(add(3, 9)).to.be(12);
expect(add('a', 8)).to.not.be.a('number');
expect(add.length).to.be(2);
@chatrjr
chatrjr / border-box.css
Created July 28, 2012 22:50
box-sizing: border-box snippet for blog post
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}