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 | |
/** | |
* Ping a host using an IMCP packet | |
* | |
* N.B. This function must be called by an administrator / root user as socket_create requires this | |
* | |
* @param string $host domain | |
* @param integer $timeout seconds | |
* @return mixed False | Response time milliseconds | |
* |
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: svn_upgrade_wordpress.sh X.X.X | |
# http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion | |
# licence MIT | |
die () { | |
echo >&2 "$@" | |
exit 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
/** | |
* Hierarchical table rows object | |
* | |
* Pure JavaScript - but comes with a IE9+ warning | |
* | |
* @param {object} options tableSelector e.g. 'table' | |
* parentClass e.g. 'parent' | |
* collapsedClass e.g. 'hidden' | |
* childClassPrefix e.g. 'parentId' | |
* @type function |
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() { | |
var form = $("form"); | |
var button = form.find("button[type=submit]"); | |
var input = form.find("input[name=postcode]"); | |
var output = form.find("output[name=location]"); | |
var map = L.mapbox.map("map", "hubbox.map-u557d78b").setView([54, 0], 6); | |
var failed = function(data) { | |
button.html("Failed"); |
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: upgrade_wordpress.sh X.X.X | |
# This is for upgrading a translated version of WordPress whilst using WordPress-Skeleton | |
# https://github.com/markjaquith/WordPress-Skeleton | |
# https://core.trac.wordpress.org/ticket/27752 | |
# licence MIT | |
die () { | |
echo >&2 "$@" | |
exit 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Minimal River Reader</title> | |
<script src="http://fargo.io/code/jquery-1.9.1.min.js"></script> | |
</head> | |
<body> | |
<script> | |
var theRiver; | |
function onGetRiverStream (updatedFeeds) { |
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
if (!String.format) { | |
/** | |
* printf function | |
* @link http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format | |
* @example var fullName = String.format('{0} {1}', firstName, lastName); | |
* | |
* @param {string} format String with replacable parameters | |
* @returns {string} formatted string | |
*/ | |
String.format = function(format) { |
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
@ECHO OFF | |
REM detach, rename and reattach one database to another | |
REM @author ICC 11 Sep 09 | |
REM @param sting Server name i.e. <Computer Name>\<SQL Server Name> e.g. .\SQLEXPRESS or COCO\SQLEXPRESS | |
REM @param string Existing database name e.g. mydb | |
REM @param string New database name e.g. mydb2 | |
REM @return none renames database, detaches database files, renames them and reattaches | |
REM usage db_swap.bat .\SQLEXPRESS mydb mydb2 | |
REM *** The following error occurs if you use a forward slash not a back slash |
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
@ECHO OFF | |
REM Backup the mincraft saves directory (uses 7-zip) | |
REM @author ICC 10 Aug 2014 | |
REM @licence MIT | |
REM usage backs up the user saves directory to the current directory | |
REM gives the filename .minecraft-saves.[User]-[Computer]-YYYY-MM-DD.bak.7z | |
REM create date in YYYY-MM-DD format | |
FOR /f "tokens=1-3 delims=/ " %%a IN ('date /t') DO (SET today=%%c-%%b-%%a) | |
REM Computer name |
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
@echo off | |
REM Start server script that won't start before a certain date and gives the IP address | |
REM current date | |
for /f "tokens=1-3 delims=/ " %%a in ('date /t') do (set olddate=%%a-%%b-%%c) | |
REM The server will run on or after this date | |
set newdate=02-08-2014 | |
set "sdate1=%olddate:~-4%%olddate:~3,2%%olddate:~0,2%" | |
set "sdate2=%newdate:~-4%%newdate:~3,2%%newdate:~0,2%" |
OlderNewer