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 | |
# 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 |
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() { | |
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; | |
} | |
} |
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
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: { |
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 | |
# 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" |
NewerOlder