Skip to content

Instantly share code, notes, and snippets.

View jfsiii's full-sized avatar

John Schulz jfsiii

View GitHub Profile

Scenario A

Goal

A pageview should be submitted to an analytics tracker whenever changedItem is triggered. Its payload should look like: {item: 'name of item', empty: Boolean}

Architecture

Module A

Emits changedItem events. Their payload is {item: 'foo'}.

Module B

Listens for changedItem events and then emits the data via itemData with {item: 'foo', data: []}.

~ ‣ ll bower_components
ls: bower_components: No such file or directory
○ ~ ‣ bower install isotope#2.0.0-beta.8
bower cached git://github.com/desandro/isotope.git#2.0.0-beta.8
bower validate 2.0.0-beta.8 against git://github.com/desandro/isotope.git#2.0.0-beta.8
bower cached git://github.com/desandro/get-size.git#1.1.7
bower validate 1.1.7 against git://github.com/desandro/get-size.git#>=1 <2
bower cached git://github.com/desandro/matches-selector.git#1.0.1
bower validate 1.0.1 against git://github.com/desandro/matches-selector.git#>=1 <2
bower cached git://github.com/desandro/masonry.git#3.1.4
{
"auto_upgrade_last_run": null,
"installed_packages":
[
"Alignment",
"All Autocomplete",
"Autoprefixer",
"Base16 Color Schemes",
"Can I Use",
"CanISwitchToSublimeText3",
define('components/ui/add_profile', function(require) {
'use strict';
/**
* Module dependencies
*/
// var defineComponent = require('flight/lib/component');
// Using flight global from standalone lib for demo purposes.
var defineComponent = flight.component;
@jfsiii
jfsiii / build.js
Last active August 29, 2015 13:58
Trying to do common + page pattern. How do I build this with the API? https://github.com/substack/node-browserify#methods
#!/usr/bin/env node
var browserify = require('browserify');
var bowerResolve = require('bower-resolve');
// shared / common
bowerResolve.init(function(){
var bCfg = {
basedir: '/path/to/repo',
noParse: [bowerResolve('jquery')]
};
BROWSERIFYSHIM_DIAGNOSTICS=1 \
$(npm bin)/browserify \
-t deamdify \
-r es5-shim \
-r es5-sham \
-r jquery \
-r flight \
-r bootstrap \
-r d3 \
-r nvd3 \
var allong = require('allong.es');
var ƒ = allong.es;
var fs = require('fs');
ƒ.sequence(ƒ.sequence.Callback,
ƒ.callLeft(fs.mkdir, './hello', 0777),
ƒ.callLeft(fs.writeFile, './hello/world.txt', 'Hello!'),
function (callback) { fs.readFile('./hello/world.txt', 'UTF-8', callback); }
)()(function(err, data) {
if (err) throw err;

Keybase proof

I hereby claim:

  • I am JFSIII on github.
  • I am jfsiii (https://keybase.io/jfsiii) on keybase.
  • I have a public key whose fingerprint is E683 A67C 044A 568A CF5C 7692 70A4 301A BD12 39FC

To claim this, I am signing this object:

@jfsiii
jfsiii / index.html
Last active August 29, 2015 14:02
Shareable React demo?
<!doctype html>
<body>
<script src="//fb.me/react-with-addons-0.10.0.js"></script>
<script src="//fb.me/JSXTransformer-0.10.0.js"></script>
<script type="text/jsx">
/** @jsx React.DOM */
function Hello(o) {
return <div>Hello, {o.name} @ {o.time}</div>;
}
@jfsiii
jfsiii / gist:ed665a1dec5381407b8e
Created June 29, 2014 21:26
Unexpected behavior from semver for pre-release versions.

From point 9 of the SemVer spec:

A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92.

However, the package npm uses to process semver values provides no way to specify a range which excludes pre-release versions.

‣ semver --range '~1.2.3' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha
1.2.3
1.2.4-alpha
1.2.4
‣ semver --range '^1.2.3' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha