Skip to content

Instantly share code, notes, and snippets.

@KleeUT
KleeUT / cloudflare_worker_sample
Last active September 30, 2021 11:27
Sample code for intro to cloudflare workers blog
const COOKIE_NAME = "__gateway_auth"
/**
* Gets the cookie with the name from the request headers
* @param {Request} request incoming Request
* @param {string} name of the cookie to get
*/
function getCookie(request, name) {
let result = ""
const cookieString = request.headers.get("Cookie")
@KleeUT
KleeUT / webpack.config.js
Created July 30, 2016 05:30
Webpack config for loading jQuery as an external.
var webpack = require('webpack');
module.exports = {
entry: [
"./client/app.js"
],
output: {
path: __dirname + '/server/public/',
filename: "bundle.js"
},
module: {
@KleeUT
KleeUT / Bio.txt
Last active January 12, 2020 00:41
My Bio for presentations
Klee is a Software Developer working at nib and organiser of the Newcastle Coders Group.
He is an Agile and Clean Code advocate who loves to talk about what we can do to build better quality, maintainable software.
Outside of software development Klee is a fan of Martial Arts, Motorcycles, Netflix and spending time with his wife and cats.
@KleeUT
KleeUT / test.webpack.config.js
Last active May 17, 2022 16:55
Webpack test config file
var webpack = require('webpack');
module.exports = {
entry: [
"mocha\!./client/test/test.js" // The mocha loader command pointing to the test root. Note the ! is escaped.
],
output: {
path: __dirname + '/client/test/', // Path to where I want testBundle.js to be put
filename: "testBundle.js"
},
module: {
@KleeUT
KleeUT / testIndex.html
Created January 25, 2016 01:14
A sample testIndex.html file for use with Webpack mocha-loader
<html>
<head>
<title>My Tests bundled by Webpack</title>
<!-- External Dependencies -->
</head>
<body>
<div id="mocha" />
</body>
<script type="text/javascript" src="./testBundle.js"></script>
</html>
@KleeUT
KleeUT / gist:13f2aab7ab4bd801da7b
Created April 10, 2015 08:36
Untrusted - Left Hand On Wall Robot Solution
initialiseRoboTracker();
if(me.canMove(me.roboTracker.directionToTheLeft())){
me.roboTracker.turnCCW();
//me.move(me.roboTracker.direction);
}else{
while(!canMoveForwardWithHandOnWall()){
me.roboTracker.turnCW();
}
}