Skip to content

Instantly share code, notes, and snippets.

View sauntimo's full-sized avatar

Tim Saunders sauntimo

View GitHub Profile
@sauntimo
sauntimo / bundle.js
Created March 10, 2025 17:28
authz-dev
/*! For license information please see auth0-authz.extension.2.13.0.js.LICENSE.txt */
"use strict";var __webpack_modules__=[(e,t,r)=>{const s=r(1),n=r(5),a=r(6),{getWebtaskUrl:i}=r(8),o=(e,t)=>{a.info("Starting Authorization Extension - Version:","2.13.0"),a.info(" > WT_URL:",e("WT_URL")),a.info(" > PUBLIC_WT_URL:",e("PUBLIC_WT_URL"));return(0,r(10).default)(e,t)};e.exports=(e,t,r)=>{((e,t,r)=>{setImmediate((()=>{t.x_wt&&t.x_wt.ectx&&t.x_wt.ectx.PUBLIC_WT_URL||n.setValue("PUBLIC_WT_URL",i(t)),s.createServer(o)(e,t,r)}))})(e,t,r)}},(e,t,r)=>{const s=r(2),n=r(3),a=r(4);e.exports.createServer=function(e){return t=a.createServer(e),async function(e,a,p){if(u=function(e){return e.read=e.secrets.EXT_STORAGE_URL?r:t,e.write=e.secrets.EXT_STORAGE_URL?i:a,e;function t(e,t,r){"function"==typeof t&&(r=t,t={}),r(s.preconditionFailed("Storage is not available in this context"))}function r(t,r,a){"function"==typeof r&&(a=r,r={}),n.get(e.secrets.EXT_STORAGE_URL).set(r.headers||{}).query({path:t}).then((e=>404===e.statusCode
#!/bin/bash
# Setup required variables
host="d51ts.vehicles.api.comcar.co.uk"
path="/v0/makes/lamborghini/models/aventador/vehicles/"
api_key="cheesecake"
api_secret="fish"
nonce="making something up here"
dev_ip="192.168.0.24"
timestamp=$(date -u +%s)
@sauntimo
sauntimo / asciiEncode.js
Last active December 13, 2018 16:40
Ascii encode dodgy characters in a given string
/**
* replaces non-db safe characters with ascii escaped sequences
* @param {string} string to ascii escape
*/
function asciiEncode(string) {
// get an array of dodgy characters
var arr_replace = string.match(/[^a-z0-9 _-~#;]/ig);
// loop over characters to replace if matches returned
arr_replace && arr_replace.forEach(function (replace) {
#!/bin/sh
# update submodules
git submodule init
git submodule update
# install root node modules
cd /var/www/vhosts/seed/
npm install
@sauntimo
sauntimo / index.cfrm
Created September 27, 2017 18:17
Start Page
<!--- cfscript --->
<cfscript>
VARIABLES.arr_stages = [
{
"name" : "staging",
"prefix" : "d5117"
},
{
@sauntimo
sauntimo / quote.js
Created August 29, 2017 15:49
Simple function which returns a boolean to the question 'was Tim quoting something'
function wasTimQuotingSomething() {
return /day$/.test(new Date().toLocaleDateString('en-gb', { weekday: 'long' }));
}
@sauntimo
sauntimo / smc.sh
Created May 15, 2017 19:25
Move dirty edits in submodules into an actual submodule and optionally commit them, pull them back into the original repo and commit them.
submodule="$1"
msg="$2"
# quit immediately if no arguments specified
if [ $# -eq 0 ]
then
echo "==> No arguments supplied"
exit 1
fi
@sauntimo
sauntimo / url_params.js
Created December 1, 2016 10:47
Get key-value object of URL params in JS
console.log( JSON.parse('{"' + decodeURI(window.location.href.replace(/^(.*\?)/, '').replace(/&/g, "\",\"").replace(/=/g,"\":\"")) + '"}') );
#include <stdio.h>
/* print Fahrenheit-Celsius table
for fahr = 0, 20, ..., 300; floating point version */
main()
{
float fahr, celsius;
#define LOWER 0 /* lower limit of temperature table */
@sauntimo
sauntimo / temp-converter
Last active August 29, 2015 14:09
Displays a table of Fahrenheit to Celsius and Celsius to Fahrenheit conversions - in a nice ASCII box :)
#include <stdio.h>
/* print Fahrenheit-Celsius table
for fahr = 0, 20, ..., 300; floating point version */
print_table_top()
{
printf("%c", 201);
print_line(24);
printf("%c\n", 187);