I hereby claim:
- I am andrioid on github.
- I am andrioid (https://keybase.io/andrioid) on keybase.
- I have a public key whose fingerprint is D4DE 3FBB F5CE 71A7 2EB3 A34B 7F7D 175F 7082 C827
To claim this, I am signing this object:
#!/bin/bash | |
# Requires Curl and Subversion Server installed. | |
# Put this file as "post-commit" with 755 permissions on the hooks directory of your repo | |
REPO_PATH=$1 | |
REV=$2 | |
LOOK=/usr/bin/svnlook | |
CURL=/usr/bin/curl | |
CHANNEL="#general" |
I needed to make a Bash script talk to a RESTish service today. | |
Found a bunch of JSON parsing tools, but no creation tools. | |
I wanted this. Does it make sense? | |
jc -all.your.base=moo -all.your.cows=beef,burger | |
{ | |
all: { | |
your: { |
(function() { | |
function updateImages(){ | |
var images = document.images; | |
for (var i=0; i<images.length; i++) { | |
var imagename = images[i].src.match(/((.*)\.(png|gif|jpg))/i); | |
if (imagename) { | |
var timestamp = new Date().getTime(); | |
images[i].src = imagename[0] + "?nocache=" + timestamp; | |
} | |
} |
#!/bin/bash | |
# Replaces params with values and outputs | |
# Note: Not really designed for complex variables. So beware of sed | |
USAGE="configparse <infile> [param1=value1 param2=value2 .. paramn=valuen]" | |
# - .e.g. configparse sitebleh.tmpl DOCROOT=/data/moo USER=ano HOSTNAME=scrolls.org | |
if [ ! "$1" ]; then | |
echo $USAGE | |
exit 1 | |
fi |
<?php | |
interface ICircuitBreakerStorage { | |
} | |
class CircuitBreaker { | |
/** | |
* StorageImplemntation should be a defined interface. | |
**/ |
I hereby claim:
To claim this, I am signing this object:
// HTTP Fire and Forget (Asynchronous, mostly - hey it's PHP!) | |
public static function SendHTTP($action, $data = null, $service = 'admin', $host = false, $port = false, $key = false){ | |
if ($port == false) { $port = Config::Get('MBISS_PORT'); } | |
if ($host == false) { $host = Config::Get('MBISS_HOST'); } | |
if ($key == false) { $key = Config::Get('MBISS_KEY'); } | |
if (data == null) { $data = array(); } | |
if ($key == false) { $key = ''; } | |
if (empty($host) || empty($port)) { return false; } |
for line in $(find . -iname '*.dtpl'); do | |
config=${line%.dtpl} | |
cp $line $config | |
echo "Replacing '$config'" | |
for key in $(cat $config | grep -o -P '({{[0-9a-z_-]+}})'); do | |
ukey=$(echo $key | sed 's/.*/\U&/' | sed -e "s/{{//" | sed -e "s/}}//") | |
val=$(eval "echo \$${ukey}") | |
#echo "Tag: $key $ukey $val" | |
if [ -n "$val" ]; then |
# change title name of tab in terminal | |
function title { | |
echo -ne "\033]0;"$*"\007" | |
} | |
enter_directory(){ | |
if [ "$PWD" != "$PREV_PWD" ]; then | |
PREV_PWD="$PWD"; | |
title $(echo ${PWD##*/}) $(node -v); | |
if [ -e ".nvmrc" ]; then |
I hereby claim:
To claim this, I am signing this object: