Skip to content

Instantly share code, notes, and snippets.

View kirklewis's full-sized avatar
🙂
try { positivity() } catch { negativity() } finally { laugh() }

Kirk Lewis kirklewis

🙂
try { positivity() } catch { negativity() } finally { laugh() }
View GitHub Profile
@kirklewis
kirklewis / Result-User.pm
Created February 4, 2017 12:02
learn-orm-perl-with-dbix
sub fullname {
my $self = shift;
return $self->firstname . ' ' . $self->lastname;
}
mkdir -p dbix-proj/{lib,scripts,t} && \
touch dbix-proj/{cpanfile,t/basic.t,scripts/{schema.sql,make_schema.pl}}
@kirklewis
kirklewis / install-couchdb.md
Created August 21, 2016 12:41
Install CouchDB and Futon

Installation

Linux (Ubuntu Distros)

# Get the latest package info
sudo apt-get update

# Fetch files for managing vendor source
sudo apt-get install software-properties-common -y
function toCamelCase(str) {
//get the words from the string, would use \w but it includes underscores.
var words = str.match(/([a-zA-Z0-9]+)/g);
words = words.map(function(word, i){
//ignore the first word otherwise its first letter will be capitalised.
if(i == 0) return word;
//capitalise first letter in each word and concatenate it onto the rest of itself. E.g. C + ode