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
/** | |
* A snippet of code I used to compare two petitions on the UK Parliament web site - wanting to know | |
* which grew fastest to challenge the claim "My Petition Is Bigger Than Yours". | |
* This input data is from the JSON download from the petition web site. | |
* A future version of this code could generalise its input to allow a petition to be selected for comparison. | |
*/ | |
const data = { | |
"Revoke Article 50":{ | |
"created_at": "2019-01-29T13:53:56.492Z", |
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
/** | |
* Implementation of Javascript Promises. | |
* A simplified version of the U4.Promise framework I wrote for Unit4 in 2013. | |
* Building it up as I need it. | |
*/ | |
var Promise = (function(){ | |
/** | |
* @private | |
* Copy properties from one object to another. | |
* @param target |
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
#!/usr/bin/perl | |
# | |
# Deploy files I'm working on to Salesforce based on the GIT status. | |
# | |
# Assumptions: | |
# Two source roots - source and systemtests. These are normal Salesforce source roots with src/classes... | |
# bin/build.xml ant script with target dev.deploy called as | |
# ant dev.deploy -Dsf.deployRoot=<stagingdir> | |
# |
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
package m0rjc.test; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLDecoder; | |
/** | |
* Decode the hex string from a Cyber Security Challenge question. | |
* This code is enough to get the job done, rather than something neat. | |
* | |
* @author Richard Corfield <[email protected]> |