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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<title>Gregorian/Julian Date Converter</title> | |
<style type='text/css'> | |
body, input { | |
margin : 0 auto; |
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
/** | |
* @param data number to format | |
* @param width how many digits the number should have, not inclusive of decimal point or sign | |
* @param dec index of the decimal point | |
* @param sign whether to include the positive sign or not | |
* @return string formatted number | |
*/ | |
function num_format(data, width, dec, sign) { | |
var res = Math.abs(data).toFixed(width - dec); | |
res = Array(width - res.replace('.', '').length + 1).join('0') + res; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='UTF-8'> | |
<title>Front page</title> | |
</head> | |
<body> | |
<table> | |
<thead> | |
<tr> |
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 lygo () { | |
str="google.co.uk/search?q=" | |
for i in $@; do | |
str="$str+$i" | |
done | |
lynx $str | |
} |
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
$HTTP["url"] =~ "\/\..*" { | |
url.access-deny = ( "" ) | |
} |
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
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
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
GREY="\[\e[0m\]" | |
CYAN="\[\e[0;36m\]" | |
YELLOW="\[\e[0;33m\]" | |
GREEN="\[\e[0;32m\]" | |
RED="\[\e[0;31m\]" | |
PS1_USER="$YELLOW[\u@\h]$GREY:" | |
PS1_PATH="[ \$? = "0" ] && echo -n '$GREEN[\w]' || echo -n '$RED[\w]' && echo -n $GREY" | |
PS1_BRANCH="[ -z \$(__git_ps1 %s) ] && echo -n '' || __git_ps1 ':$CYAN[%s]$GREY'" |
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
/** | |
* @param $dat a php array or variable | |
* prints the parameter to the javascript console, only suitable for use inside dom elements | |
*/ | |
function var_dump_js($dat) { | |
echo '<script type=\'text/javascript\'>console.log(' . json_encode($dat) . ');</script>'; | |
} |
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 | |
# usage: | |
# copy-directory-structure.sh <target> <destination> | |
if [ ! -d $2 ]; then | |
mkdir $2 | |
fi | |
find $1 -type d > $2/.lst |
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 | |
# @author gideon mw jones | |
# @created 2013-12-27 | |
# @version 1 | |
# creates a directory structure board for snakes & ladders | |
BRDSZ=100 | |
# initialising board & links |