# Get the latest package info
sudo apt-get update
# Fetch files for managing vendor source
sudo apt-get install software-properties-common -y
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p dbix-proj/{lib,scripts,t} && \ | |
touch dbix-proj/{cpanfile,t/basic.t,scripts/{schema.sql,make_schema.pl}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub fullname { | |
my $self = shift; | |
return $self->firstname . ' ' . $self->lastname; | |
} |
I hereby claim:
- I am kirklewis on github.
- I am kirklewis (https://keybase.io/kirklewis) on keybase.
- I have a public key whose fingerprint is D9FF 94AB C80F A0DA 0940 E7A8 6E02 7D52 9BAF A6BF
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.20.3; | |
use strict; | |
use warnings; | |
# Basic String Interpolation with Scalars and Lists | |
my $PI = 3.14; | |
my @nums = (3, 2, 1); | |
say "scalar: $PI - list: @nums"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEFAULT='\033[0m' | |
HI_CYAN='\033[0;96m' | |
HI_WHITE='\033[0;93m' | |
STATSD_HOST=127.0.0.1 | |
STATSD_PORT=8125 | |
api_names=(orders invoice user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"text/template" | |
) | |
func main() { | |
// variables | |
vars := make(map[string]interface{}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.yaml.YamlSlurper | |
def yamlSlurper = new YamlSlurper() | |
def yaml = yamlSlurper.parseText('''\ | |
- 100 | |
- 50 | |
- 1 | |
''') | |
assert yaml instanceof List |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.yaml.YamlBuilder | |
def counts = [ 1, 2, 3 ] | |
def yaml = new YamlBuilder() | |
yaml(counts) | |
assert yaml.toString() == '''\ | |
--- | |
- 1 | |
- 2 |
OlderNewer