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 sh | |
# @see http://stackoverflow.com/questions/30040708/how-to-mount-local-volumes-in-docker-machine | |
# @see https://github.com/boot2docker/boot2docker/blob/master/doc/FAQ.md | |
################################################################################ | |
# Dependency Section # | |
# # | |
################################################################################ | |
check_deps() { | |
## Make sure commands are available |
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
prev_cmt="" | |
for cmt in $(git lg package.json | awk '{print $2}'); | |
do | |
git co $cmt >/dev/null 2>&1 | |
cat package.json | grep 'package-name' >/dev/null 2>&1 | |
# will fail if does not find the package-name in the current commit | |
if [ $? -ne 0 ] ; then | |
echo "cmt: $cmt" | |
echo "prev_cmt: $prev_cmt" | |
git co main |
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
# Write NPM_TOKEN registry without BOM @see https://stackoverflow.com/a/32951824 | |
[IO.File]::WriteAllLines("$(Get-Location)\.npmrc", "//registry.npmjs.org/:_authToken=$env:NPM_TOKEN") | |
# Set Custom NPM_CONFIG_USERCONFIG Environment variable | |
$env:NPM_CONFIG_USERCONFIG="$(Get-Location)\.npmrc" | |
# debug who you are | |
# npm whoami | |
# replace * with the npm script you want to run. |
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
# CCZE Colourize Config for Centos | |
# http://lintut.com/colorize-log-files-on-linux-using-ccze-tool/ | |
# http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ | |
CCZE=`which ccze` | |
if [ "$TERM" != dumb ] && [ -n "$CCZE" ] | |
then | |
function colourify { `$@` | $CCZE -A } | |
alias colourify=colourify | |
alias configure='colourify ./configure' |
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
--[[ | |
LUA variant of the php unserialize function | |
Port of http://phpjs.org/functions/unserialize | |
]]-- | |
local function unserialize (data) | |
local function utf8Overhead (chr) | |
local code = chr:byte() | |
if (code < 0x0080) then | |
return 0 |
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
<?php | |
/** | |
* Validate orgnr | |
* Validates an string number according to the brreg spec | |
* https://www.brreg.no/om-oss/oppgavene-vare/alle-registrene-vare/om-enhetsregisteret/organisasjonsnummeret/ | |
* | |
* Test case: https://repl.it/repls/TechnicalForcefulBsddaemon | |
* | |
* @param <string> $value |
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
const pattern = | |
new RegExp( | |
// starts with PT | |
'^PT' + | |
// one or more digits followed by the hours designator H | |
'((\\d+)H){0,1}' + | |
// one or more digits followed by the minutes designator M | |
'((\\d+)M){0,1}' + | |
// one or more digits with precission followed by the seconds designator S | |
'((\\d+(\\.\\d+){0,1})S){0,1}' + |
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 parseDesignators (duration) { | |
return [ | |
{ | |
name: 'hours', | |
designator: 'H' | |
}, | |
{ | |
name: 'minutes', | |
designator: 'M' | |
}, |
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 strpos (haystack, needle, offset) | |
local pattern = string.format("(%s)", needle) | |
local i = string.find (haystack, pattern, (offset or 0)) | |
return (i ~= nil and i or false) | |
end |
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
# Install Haxe using Brew and set the haxelib path | |
brew install haxe | |
haxelib setup /usr/local/Cellar/haxe/lib | |
# Install lime | |
haxelib install lime | |
haxelib run lime setup | |
# Install lime tools | |
haxelib install format |
NewerOlder