Skip to content

Instantly share code, notes, and snippets.

Nick Lombard nickl-

Block or report user

Report or block nickl-

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nickl-
nickl- / UUID.php
Last active Nov 13, 2019 — forked from dahnielson/UUID.php
Pure PHP UUID generator
View UUID.php
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
View gist:11198678
### Keybase proof
I hereby claim:
* I am nickl- on github.
* I am nickl (https://keybase.io/nickl) on keybase.
* I have a public key whose fingerprint is 6D00 65D1 995A 0CCE B5EB 899F AA73 BC57 DE7A B31E
To claim this, I am signing this object:
View install-erlang-ubuntu-precise.sh
#!/bin/bash
# You will need to make this file executable (chmod +x) and run it with sudo
# Optionally supply the version number you want to build
[[ $1 ]] && VERSION=$1 || VERSION=R16B03-1
apt-get update
apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
mkdir -p /src/erlang
cd /src/erlang
wget -c http://www.erlang.org/download/otp_src_${VERSION}.tar.gz
tar zxvf otp_src_${VERSION}.tar.gz
@nickl-
nickl- / gist:5432541
Created Apr 22, 2013
New look Respect/Foundation as a result of menu rendering refactor.
View gist:5432541
# Respect/Foundation: 0.1.13
General Utilities
=================
project-info:.............Shows project configuration
project-init:.............Initialize current folder and create boilerplate project structure
gitignore:................(Re)create .gitignore file
Source Cleaning
@nickl-
nickl- / FluentCache.php
Last active Dec 13, 2015 — forked from alganet/FluentCache.php
The SimpleCache interface which enables cache invalidate and exposes a single method seen to manage get, save, saveAll, and delete. Simplicity is one goal but this enables us to easily extend your Cache implementation with SimpleCacheApc, SimpleCacheMemcached, SimpleCacheRedis, SimpleCacheElasticSearch, etc. of the same SimpleCache interface.
View FluentCache.php
<?php
interface SimpleCache {
function seen($key, $value=false);
function invalidate($key=false, DateTime $expire=null);
}
class FluentCache extends \ArrayObject implements SimpleCache
{
private $cache,
@nickl-
nickl- / compounded.php
Created Feb 6, 2013
$ time php compounded.php real 5m18.547s user 0m51.590s sys 0m0.490s
View compounded.php
<?php
function foo() { return true; }
function bar() { return true; }
function baz() { return false; }
function bat() { return true; }
function lorem() { return true; }
function ipsum() { return true; }
function dolor() { return false; }
function sit() { return false; }
function amet() { return true; }
@nickl-
nickl- / deep-heart.php
Created Feb 6, 2013
$ time php deep-heart.php real 4m37.395s user 0m46.954s sys 0m0.434s
View deep-heart.php
<?php
function foo() { return true; }
function bar() { return true; }
function baz() { return false; }
function bat() { return true; }
function lorem() { return true; }
function ipsum() { return true; }
function dolor() { return false; }
function sit() { return false; }
function amet() { return true; }
@nickl-
nickl- / complex.php
Created Feb 6, 2013
$ time php complex.php real 3m9.142s user 0m32.125s sys 0m0.358s
View complex.php
<?php
function foo() { return true; }
function bar() { return true; }
function baz() { return false; }
function bat() { return true; }
function lorem() { return true; }
function ipsum() { return true; }
function dolor() { return false; }
function sit() { return false; }
function amet() { return true; }
@nickl-
nickl- / gist:4696036
Last active Dec 12, 2015
PHP optimized strtotime() for 24hr time stnings
View gist:4696036
<?php
/**
* Optimized strtotime function.
* For turning 24hr time in the form HH:MM:SS into its equivalent
* epoch time.
*
* Returns the same result as strtotime but instead of 0m29.337s
* for 1 million records it only takes 0m15.243s or a whopping
* 192% performance boost.
*
@nickl-
nickl- / gist:4584270
Last active Dec 11, 2015
simmetrics exampleProgram all
View gist:4584270
$ ./exampleProgram/exampleProgram all simmetrics symmetrics
Block Distance between simmetrics & symmetrics is 1 and yields a 50% similarity
Cosine Similarity between simmetrics & symmetrics is not applicable and yields a 0% similarity
Dice Similarity between simmetrics & symmetrics is not applicable and yields a 0% similarity
Euclidean Distance between simmetrics & symmetrics is 1.41 and yields a 29% similarity
Jaccard Similarity between simmetrics & symmetrics is not applicable and yields a 0% similarity
Jaro Similarity between simmetrics & symmetrics is not applicable and yields a 87% similarity
Jaro Winkler Similarity between simmetrics & symmetrics is not applicable and yields a 88% similarity
Levenshtein Distance between simmetrics & symmetrics is 1 a
You can’t perform that action at this time.