Skip to content

Instantly share code, notes, and snippets.

View pgoldrbx's full-sized avatar

Phil Gold pgoldrbx

View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

function MyStringClass(str) {
var map = {};
// front-load the work and has the string
for (var i = 0; i < str.length; i++) {
var char = str[i];
map[char] = map[char] || 0;
map[char]++;
}
@pgoldrbx
pgoldrbx / action.js
Last active August 29, 2015 14:19
Flux demo
'use strict';
var dispatcher = require('flux').dispatcher;
exports.load = function () {
dispatcher.dispatch('LOAD', {
foo: 'bar'
});
};
'use strict';
var React = require('react');
var LazyLoad = React.createClass({
getInitialState: function () {
return {
ready: false
};
},

Using React Components in a MVC-like architecture for Client- or Server-side rendering

React

Goals

  • What problems are we trying to solive with React?
  • What are the added benefits of using React?
  • What potential issues or limitations com with using React?
@pgoldrbx
pgoldrbx / gist:ddc40f4d196a957286dd
Last active August 29, 2015 14:09
.eslintrc preferences
{
// Environments
// defines both global variables that are predefined as well as which rules
// should be on or off by default
"env": {
"browser" : true, // Browser global variables
"node" : true, // Node.js global variables and Node.js-specific rules
"amd" : true, // Defines require() and define() as global variables as per the amd spec.
"mocha" : false, // Adds all of the Mocha testing global variables.
@pgoldrbx
pgoldrbx / gist:d730cda13de64db69175
Last active June 22, 2016 23:53
This ___ isn't working... did I do something dumb?

Why aren't I seeing my changes?

What do you mean 404 error?!?

Oh come ON, I just DID that!

How often are you working on something and are stuck trying to debug some irritation problem, only to discover after time that you've done something embarrassingly stupid? It's good to go through a checklist of "dumb" questions before spending an hour in the debugger or pouring over changesets.

Example:

  • Is the computer plugged in? (classic tech support!)