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
// AJAX variable | |
var xmlhttp; | |
// Work out IE Version number (if any) | |
var ieVer = -1; | |
if (navigator.appName == 'Microsoft Internet Explorer') | |
{ | |
var ua = navigator.userAgent; | |
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); | |
if (re.exec(ua) != null) |
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 /* SVG PATH MANIPULATION FUNCTIONS | |
rotatePath(), mirrorPath(), reversePath(), scalePath(), translatePath(), matrixPath() and makeRelativePath() | |
The path argument is the string value of the 'd' attribute of the svg 'path' element, NOT the whole element | |
Other arguments should be self-explanatory | |
The return value is a string that can used as the value of the 'd' attribute | |
It is usually best to make the path relative first, then carry out other manipulations | |
Shortcomings: | |
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
// | |
// Notifier.swift | |
// | |
// Created by Karl Wilcox on 07/05/2015. | |
// Copyright (c) 2015 Karl Wilcox. | |
// | |
/* Description: A very simple notification framework. | |
Objects may register a call back for when pre-defined event types occur, and other objects may indicate that | |
those events have occurred. A typical use case would be a switching view controller type application |
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
// | |
// UIColorByHexString.swift | |
// | |
// Created by Karl Wilcox on 10/05/2015. | |
// Copyright (c) 2015 Karl Wilcox. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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
// | |
// HTMLBuilder.swift | |
// | |
// Created by Karl Wilcox on 16/03/2015. | |
// Copyright (c) 2015 Karl Wilcox. All rights reserved. | |
// | |
import Foundation | |
/// Builds and returns valid HTML for use in UIWebView |
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
// This is a combination of an SVG import function from http://stackoverflow.com/users/405017/phrogz | |
// and a posting by Daniel McCabe https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5579311/ | |
// It allows an SVG object (obtained for example, from an AJAX request) to be correctly displayed in the | |
// Microsoft Edge browser (which otherwise would change some of the attribute names to all Upper Case) | |
// For example, I call this function if (navigator.userAgent.indexOf('Edge') > 0) | |
function cloneAndFix(node,doc){ | |
var corrections = new Array ( | |
'attributeName', | |
'attributeType', | |
'baseFrequency', |
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 | |
# Various utilities to help with the GCHQ Puzzle Book... | |
wordlist="/usr/share/dict/british-english" | |
formatter="column" | |
# turn off filename globbing (we never need it) | |
set -f | |
if [[ $# -lt 2 ]]; then |
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
<?xml version="1.0"?> | |
<!-- | |
Basic XSL transform to convert a WordPress "export" file into a set of separate files, one for each WordPress Page (or Post). This uses | |
xsl:result-document and so needs an XSL 3.0 processor such as | |
Michael Kay's SaxonHE. A typical command line would be: | |
java -jar saxon9HE.jar <WORDPRESS-EXPORT-FILE>.xml convertWPtoEJS.xsl > _data.json | |
--> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"> | |
<!-- The content is enclosed in CDATA, we want to output the raw text --> | |
<xsl:output method="text" cdata-section-elements="content:encoded"/> |
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
const Discord = require('discord.js'); | |
const fetch = require('node-fetch'); | |
const querystring = require('querystring'); | |
const client = new Discord.Client(); | |
const prefix = '!'; | |
const helpInfo = { | |
define: "*!define <term>*\nProvide a brief definition of a heraldic term (Searches Parker's heraldic dictionary, and Elvins' Heraldic dictionary) and provides a link to the full entry.", |
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
const Discord = require('discord.js'); | |
const fetch = require('node-fetch'); | |
const querystring = require('querystring'); | |
const crypto = require('crypto'); | |
const fs = require('fs'); | |
const { exec } = require('child_process'); | |
const limit = 500; | |
const client = new Discord.Client(); |
OlderNewer