Skip to content

Instantly share code, notes, and snippets.

@stewartduffy
stewartduffy / gist:6bd7fad208bf98043966
Last active August 29, 2015 14:16
JS get calculate GST
var calculateGst = function(price, taxRate) {
return (price * (taxRate * 100) / 100).toFixed(2);
};
var addGst = function(price, taxRate) {
return (price * 1 + ( price * (taxRate * 100) / 100 )).toFixed(2);
};
@stewartduffy
stewartduffy / gist:1481230253d6fbc366df
Created March 3, 2015 22:57
Create GUID / UUID in JavaScript
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Danish Royalty/Danish Royalty.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "load/save",
"linters": {
"htmltidy": {
@stewartduffy
stewartduffy / .htaccess
Last active August 29, 2015 14:20 — forked from jxnblk/.htaccess
Options +FollowSymLinks
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</ifModule>
@stewartduffy
stewartduffy / blog.md
Last active March 29, 2016 20:39
Hello Gistlog

This is cool init!

@stewartduffy
stewartduffy / blog.md
Last active April 12, 2016 06:55
I have a landing page
@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}) => (

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:

{
"jobs": [
{
"name": "Westpac",
"link": "https://www.westpac.co.nz/",
"city": "Auckland, NZ",
"startDate": "December 2020",
"endDate": "Present"
},
{
@stewartduffy
stewartduffy / myscript.js
Last active October 17, 2018 21:55
Script loader
function doMyBidding() {
alert('yes me lord');
}