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%" |
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
/** | |
* Dismissable divs that stay dismissed when you dismiss them | |
* | |
* Besides the dismiss/check its also a generic Cookie monster | |
* | |
* The cookie code is intially from the uk-cookie-consent plugin | |
* @link https://wordpress.org/plugins/uk-cookie-consent/ | |
* | |
* Make the js less obtrusive | |
* @link http://www.w3.org/wiki/The_principles_of_unobtrusive_JavaScript |
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 | |
# mysqldump your product database to database_name_here.sql | |
# transfer it to this file's directory on another server | |
# copy wordpres_migrate.yml to this file's directory and update the variables | |
# usage: wordpress_migrate.sh [config.yml] | |
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
# taken from jplew's excellent SyncDB | |
# @link https://github.com/jplew/SyncDB/blob/master/syncdb | |
all_db_name=$(sed -n "s/.*DB_NAME', '\([^']*\)'.*/\1/p" wp-config.php) | |
all_db_user=$(sed -n "s/.*DB_USER', '\([^']*\)'.*/\1/p" wp-config.php) | |
all_db_pass=$(sed -n "s/.*DB_PASSWORD', '\([^']*\)'.*/\1/p" wp-config.php) | |
all_db_host=$(sed -n "s/.*DB_HOST', '\([^']*\)'.*/\1/p" wp-config.php) |
OlderNewer