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
// receive POST to /convert, with POST fields: | |
// svg - SVG image data | |
// format - format to convert image to (see switch below) | |
// width - width of converted image in pixels | |
// height - height of converted image in pixels | |
const express = require('express'); | |
const multer = require('multer'); | |
const upload = multer({ limits:{fieldSize: 25 * 1024 * 1024} }); | |
const sharp = require("sharp"); |
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'); | |
require('dotenv').config(); | |
const querystring = require('querystring'); | |
const client = new Discord.Client(); | |
const prefix = '!'; | |
const { exec } = require("child_process"); |
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
import requests | |
import base64 | |
from IPython.display import Image, display | |
# example usage: | |
# drawshield("azure a bend or") | |
# For more detailed information use | |
# drawshield("azure a bend or", True) | |
def drawshield(blazon, debug = False): | |
url = "https://drawshield.net/include/drawshield.php" |
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 | |
$subArg = ''; | |
function subFunc( $match ) { | |
global $subArg; | |
if ( $match[0]{2} == '}' ) { | |
return $subArg; | |
} else { | |
$val = floatVal(substr($match[0],3)); |
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(); |
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
<?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
#!/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
// 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
// | |
// 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 |
NewerOlder