Skip to content

Instantly share code, notes, and snippets.

View camilleriluke's full-sized avatar
🐢

Luke Camilleri camilleriluke

🐢
View GitHub Profile
@camilleriluke
camilleriluke / fib-js.js
Last active December 26, 2015 05:09
Fibonacci Sequence using JavaScript Arrays
function fibonacci(n) {
return Array.apply(0, new Array(n)).reduce(function(seq, current, index) {
return seq.concat((index < 2) ? index : seq[index-1] + seq[index-2]);
}, []);
}
@camilleriluke
camilleriluke / yesno.js
Created November 15, 2013 10:29
The answer to all life decisions.
((~~(Math.random()*10))%2 ? "Yes" :"No don't") + " do it!"
@camilleriluke
camilleriluke / DBConnection.java
Created October 20, 2014 17:25
Unit Testing Workshop Exercises Interfaces
public interface DBConnection {
/**
* Commits a student to this connection.
*
* @param student the student to be committed.
* @return <code>0</code> if committed successfully, <code>-1</code> otherwise.
*/
int commitStudent(Student student);
}
@camilleriluke
camilleriluke / landing.html
Created December 3, 2014 17:32
Simple Session Example Test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Session example test</title>
</head>
<body>
<h1>Session exmaple test</h1>
<form action="session-example.php" method="post">
<label for="fullname">Full Name: </label><input type="text" name="fullname">
@camilleriluke
camilleriluke / brew_completer.sh
Last active August 26, 2015 08:14 — forked from ktheory/brew_completer.sh
Bash tab-completion for homebrew
# Bash tab-completion for homebrew (https://github.com/mxcl/homebrew)
###############
# Installation:
# mkdir ~/.bash_completion.d
# curl https://gist.github.com/raw/774554/brew_completer.sh > ~/.bash_completion.d/brew_completer.sh
# echo 'source ~/.bash_completion.d/brew_completer.sh' >> ~/.bashrc
# source ~/.bashrc
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:1449480248801,1454509691508,1454509733157,1454509751764,1454608046142,1454665081786,1454665089704,1454665095511</id>
<updated>2016-02-08T15:30:39Z</updated>
<author>
<name>Luke Camilleri</name>
<email>[email protected]</email>
</author>
<entry>
<category term='filter'></category>
@camilleriluke
camilleriluke / prepare-commit-msg
Last active February 9, 2019 07:50
prepare-commit-msg
#!/bin/sh
# Add this in your .git/hooks folder
firstLine=$(head -n1 $1)
if [ -z "$firstLine" ] ;then
BRANCH_NAME=`git rev-parse --abbrev-ref HEAD`
APPEND_TO_COMMIT_MSG="# Branch does not contain an issue id, feel free to add your own.\n\n# Casumo/Home#"
if [[ $BRANCH_NAME == iss* ]]; then
APPEND_TO_COMMIT_MSG="`echo $BRANCH_NAME | sed -e 's/iss\([0-9]*\)\(.*\)/# Casumo\/Home#\1/g'`"
@camilleriluke
camilleriluke / .gitconfig
Last active February 14, 2019 12:55
gitconfig primer
[core]
excludesfile = /Users/CHANGE_HERE/.gitignore_global
pager = diff-so-fancy | less -r
editor = code -w
[user]
name = YOUR_NAME
useConfigOnly = true
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
ignore-file = !git update-index --assume-unchanged
@camilleriluke
camilleriluke / partyparrot.text
Created September 1, 2016 10:42
Party Parrot
:fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot:
:party-parrot-conga:                :party-parrot-conga-reverse:
:party-parrot-conga:      *PARTY PARROT Crew*      :party-parrot-conga-reverse:
:party-parrot-conga:                :party-parrot-conga-reverse:
:party-parrot-conga:        :party-parrot:        :party-parrot-conga-reverse:
:party-parrot-conga:                :party-parrot-conga-reverse:
:party-parrot-conga:                :party-parrot-conga-reverse:
:fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot::fast-parrot:
@camilleriluke
camilleriluke / flow-example.js
Last active May 30, 2017 13:43
✔️ Simple type annotated flow example
// @flow
import type {KnockoutComputed, KnockoutObservable} from 'knockout';
import ko from 'knockout';
interface FooJSON {
name: string;
surname: string;
}
interface FooModel {