Skip to content

Instantly share code, notes, and snippets.

View josephdburdick's full-sized avatar
😇
Mentally present

Joe josephdburdick

😇
Mentally present
View GitHub Profile
const spacingFactor = 8;
export const spacing = {
space0: `${computeGoldenRatio(spacingFactor, 0)}px`, // 8
space1: `${computeGoldenRatio(spacingFactor, 1)}px`, // 13
space2: `${computeGoldenRatio(spacingFactor, 2)}px`, // 21
space3: `${computeGoldenRatio(spacingFactor, 3)}px`, // 34
space4: `${computeGoldenRatio(spacingFactor, 4)}px`, // 55
space5: `${computeGoldenRatio(spacingFactor, 5)}px`, // 89
};
@josephdburdick
josephdburdick / Contract Killer 3.md
Created October 23, 2016 21:18
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@josephdburdick
josephdburdick / random.js
Created September 12, 2016 22:47 — forked from kerimdzhanov/random.js
Javascript get random number in a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {float} a random floating point number
*/
function getRandom(min, max) {
return Math.random() * (max - min) + min;
}
src
.idea/
node_modules
# Logs
logs
*.log
npm-debug.log*
# compiled js
dist
# Dependency directories
node_modules
{
"presets": [
"stage-2",
"es2015"
],
"plugins": [
"transform-flow-strip-types",
"transform-object-assign",
"transform-class-properties",
"transform-runtime"
[libs]
[ignore]
[options]
{
"env": {
"browser": true,
"builtin": true,
"jasmine": true,
"mocha": true,
"node": true
},
"extends": "airbnb",
"globals": {
@josephdburdick
josephdburdick / smarten.js
Created July 7, 2016 20:32 — forked from hkfoster/smarten.js
Replace dumb quotes with smart quotes, double dashes with an em dash, and three dots with an ellipsis.
// Make punctuation smarter
jQuery.fn.smarten = (function() {
function smartenNode(node) {
if (node.nodeType === 3) {
node.data = node.data
.replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018") // Opening singles
.replace(/'/g, "\u2019") // Closing singles & apostrophes
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201c") // Opening doubles
.replace(/"/g, "\u201d") // Closing doubles
@josephdburdick
josephdburdick / gulpfile.js
Last active September 21, 2015 22:42 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));