Skip to content

Instantly share code, notes, and snippets.

💎
Working from home

Jed Richards jedrichards

💎
Working from home
Block or report user

Report or block jedrichards

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View LoginCallback.js
import React, { Component } from 'react'
import { Auth0Context } from './'
class LoginCallbackInner extends Component {
componentDidMount() {
this.props.auth0.onLogin()
}
render() {
@jedrichards
jedrichards / gist:7916199
Last active Dec 31, 2015
Marionette One Page Web Apps
View gist:7916199

Marionette One Page Web Apps

Essential Elements

A Grunt build process

  • General development is done on your unbuilt files
  • Set up a watch task to continually compile CSS
  • Don't attempt to build and optimise the entire site in a watch task, it'll take too long
  • When ready to deploy your site then compile/uglify/minify/concat into a dedicated 'build' folder
@jedrichards
jedrichards / gist:5734577
Last active Dec 18, 2015
Camping expense computation
View gist:5734577
Creating members
----------------
Jed
Natty
Jamie
Owen
Laura
Nicci
Oli
Aysha
View gist:5590832
// extend.js
define(function (require) {
var _ = require("vendor/underscore");
var ctor = function () {};
var inherits = function (parent,protoProps,staticProps) {
var child;
if (protoProps && protoProps.hasOwnProperty("constructor")) {
@jedrichards
jedrichards / gist:4141229
Created Nov 24, 2012
Sublime Text 2 User Settings
View gist:4141229
{
"auto_complete_delay": 0,
"caret_style": "blink",
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"find_selected_text": true,
"fold_buttons": false,
"font_face": "Ubuntu Mono",
"font_options":
[
"no_bold",
View gist:ed8fd58e22d44c1212e8
var randomChars = "jldfsifnJSODNBD~±§1234567890!@£$%^&*()-=_+,./<>?";
function easeOut (t,d,p) {
return 1-Math.pow(1-(t/d),p);
}
function randomInt (min,max) {
return Math.floor(Math.random()*(max-min+1))+min;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am jedrichards on github.
  • I am jedrichards (https://keybase.io/jedrichards) on keybase.
  • I have a public key whose fingerprint is D1AF 6344 8674 3A46 A647 1904 689C 2EA8 416A 1AA1

To claim this, I am signing this object:

View README.md

ES6 Generators

  • Available in ES6 Harmony
  • Present in Node 0.11 unstable and above
  • Enable via the --harmony or --harmony-generators flag in 0.11

Intro

Generators are constructor functions for iterators.

View debug.md

Debug Workshop

General tips

❉ Create a new user in Chrome just for use with debugging, ensures no plugins or extensions are adding JS to the page and confusing the issue. Extension code and iframes will show up when you're trying to profile code and get in the way. You're aiming for as close to a totally vanilla browser tab as possible.

❉ Be aware Chrome dev tools add a fair bit of CPU/memory overhead to the page

❉ "Art" of debugging: replicate, isolate, eliminate. Replication is the hardest part. "Works for me" not really an acceptable answer.

You can’t perform that action at this time.