Skip to content

Instantly share code, notes, and snippets.

@tomchiverton
tomchiverton / gist:e6bb21e05ebc0ff66c7060eae89f6594
Created April 15, 2024 10:01
Lucee datetime parser oddness
<cfscript>
s='2024-04-11T15:28:37.9663866Z';
writedump( ParseDateTime(s) )
writedump( ParseDateTime(s.listgetAt(1,'.') ))
writedump( server.lucee.version )
</cfscript>
chars = "0123456789ACEFHJKLMNPRTVWXY"; // no B, only 8. No I only 1. etc
chars_length = chars.len()
// Based on https://cflib.org/udf/nBase36
public string function int_to_id(numeric num){
var stream = '';
var res = "";
var l = chars_length
if (num GT 0) {
while (num GT 0) {
https://www.formula1.com/en/f1-live.html
For dev console:
$.cookie('login-session', JSON.stringify({ data:{subscriptionToken:{ SubscriptionStatus :'active' }} }) )
window.jwt_decode = function( ){return { SubscriptionStatus :'active' } }
break @ webservice.js:2602
// subscriptionToken in cookie should be a base64 encoded JWT but unclear where checks
-- before update
a2s3d5f6 /wwwroot/clients/leeds/p/patientpass/stage,/wwwroot/clients/leeds/p/patientpass/release
z0x9c8v7 /wwwroot/clients/srft/p/patientpass/stage,/wwwroot/clients/srft/p/patientpass/release
f8g7g6r4 /wwwroot/clients/srfts/p/patientpass/dev,/wwwroot/clients/leeds/p/patientpass/dev
-- update dev to new branch version
a2s3d5f6 /wwwroot/clients/leeds/p/patientpass/stage,/wwwroot/clients/leeds/p/patientpass/release
z0x9c8v7 /wwwroot/clients/srft/p/patientpass/stage,/wwwroot/clients/srft/p/patientpass/release
<cfscript>
string='<methodResponse>
<params>
<param>
<value>
<array>
<data>
<value>
<string>
<![CDATA[thisdomain.net]]>
<cfscript>
currentLocale = getLocale();
setLocale(currentLocale);
writeOutput("Original: ");
writeDump(getLocale());
writeDump(now());
writeDump(DateTimeFormat(now(),'d MMM yyyy - HH:nn'));
writeDump(DateTimeFormat(now(),'d MMM yyyy - HH:nn','Europe/London'));
@tomchiverton
tomchiverton / route53.py
Last active January 6, 2020 16:56 — forked from nh2/route53.py
route53 hook for dehydrated - python2 / python3 + boto2 version. Tested on Ubuntu 16.04
#!/usr/bin/env python
# How to use:
#
# Ubuntu 16.04: apt install -y python-boto OR apt install -y python3-boto
#
# Specify the default profile on aws/boto profile files or use the optional AWS_PROFILE env var:
# AWS_PROFILE=example ./dehydrated -c -d example.com -t dns-01 -k /etc/dehydrated/hooks/route53.py
#
# Manually specify hosted zone:

Keybase proof

I hereby claim:

  • I am tomchiverton on github.
  • I am falken (https://keybase.io/falken) on keybase.
  • I have a public key whose fingerprint is AAA7 ACCA 967D D815 19C4 05AC 00A3 5C6A 1C12 B561

To claim this, I am signing this object:

@tomchiverton
tomchiverton / upload.cfc
Created September 19, 2012 11:50 — forked from jsteenkamp/upload.cfc
ColdFusion code for Plupload file uploading including chunked transfers
<cfcomponent>
<cffunction name="upload" access="remote" returntype="struct" returnformat="json" output="false">
<cfscript>
var uploadDir = getTempDirectory(); // should be a temp directory that you clear periodically to flush orphaned files
var uploadFile = uploadDir & arguments.NAME;
var response = {'result' = arguments.NAME, 'id' = 0};
var result = {};
// if chunked append chunk number to filename for reassembly
if (structKeyExists(arguments, 'CHUNKS')){
@tomchiverton
tomchiverton / app.js
Created August 15, 2012 09:47
EmberJS list control that can tell what was clicked
window.EvEditor=Em.Application.create({
VERSION: "0.0.2",
main:{ componentList:[{name:'a'},{name:'b'},{name:'c'}],
ComponentView : Em.View.extend({
tagName: 'li',
removeItem: function() {
var component = this.get('component');
alert(component.name);
}
})