Skip to content

Instantly share code, notes, and snippets.

{
"jobs": [
{
"name": "Westpac",
"link": "https://www.westpac.co.nz/",
"city": "Auckland, NZ",
"startDate": "December 2020",
"endDate": "Present"
},
{
@stewartduffy
stewartduffy / gist:481f21ea4906e611d934
Last active August 10, 2022 03:03
Regex to remove file extension from JS string.
var filenameFull = "tm_icons.png";
//Regex to remove
var filenameText = filenameFull.replace(/\.[^/.]+$/, "");
console.log('location.host ' + location.host);
console.log('location.origin ' + location.origin);
@stewartduffy
stewartduffy / myscript.js
Last active October 17, 2018 21:55
Script loader
function doMyBidding() {
alert('yes me lord');
}

Keybase proof

I hereby claim:

  • I am stewartduffy on github.
  • I am stewartduffy (https://keybase.io/stewartduffy) on keybase.
  • I have a public key ASARwN_OJIt_ocd1JKk5HsgC8RiK6xCmoL8lufcYoVNKgwo

To claim this, I am signing this object:

@stewartduffy
stewartduffy / Example.js
Last active February 17, 2017 08:43
Redux Form Validation
/*
* Simple example of how to use the validators in a Redux form
* This file is pseudo code
*/
// Other imports would go above here ^^
import {validators, validatedForm} from 'common/validation' // import validators & validatedForm
import {details} from './actionMaps'
const Details = ({data, fields, handleSubmit, resetForm, close, dirty}, {trans, permissions}) => (
@stewartduffy
stewartduffy / blog.md
Last active April 12, 2016 06:55
I have a landing page
@stewartduffy
stewartduffy / blog.md
Last active March 29, 2016 20:39
Hello Gistlog

This is cool init!

function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};