Skip to content

Instantly share code, notes, and snippets.

Jeffrey Wear wearhere

Block or report user

Report or block wearhere

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
wearhere / client.js
Last active Jun 8, 2018
Making SSE easy
View client.js
import _ from 'underscore';
import $ from 'jquery';
import Backbone from 'backbone';
const DataCollection = Backbone.Collection.extend({
url() {
return '/api/data';
fetch() {
wearhere / main.js
Created Dec 3, 2017
Minimal Babel setup for use with React "hello world". External dependencies purposefully not handled—see for solutions.
View main.js
import React from 'react';
import ReactDOM from 'react-dom';
<h1>Hello, world!</h1>,
wearhere / actual.js
Last active Jul 28, 2017
Draft of module for adding custom helpers as well as a bind operator that caches. Solution for
View actual.js
var f = ctx::ns.obj.func;
var g = ::ns.obj.func;
var h = new X::y;
wearhere / promisify.js
Created Mar 21, 2017
Simple promisify.
View promisify.js
function promisify(fn) {
return function(...args) {
return new Promise((resolve, reject) => {, ...args, (err, res) => {
if (err) reject(err);
else resolve(res);
wearhere / test.js
Last active Jun 19, 2018
Using async/await with Bluebird in Node 7.6.0.
View test.js
/* eslint no-console: false */
const bluebird = require('bluebird');
function isBluebirdPromise(promise) {
return promise.constructor === bluebird;
function respond() {
return new bluebird((resolve) => {
setTimeout(() => resolve('hi'), 2000);
wearhere / link.css
Created Mar 1, 2017
Mostly put's GitHub's link color to back to how it was before 03.01.2017, i.e. not stabbing your eyes. Credit to Load using a Chrome extension like Stylebot.
View link.css
wearhere /
Last active Feb 10, 2017
Shell functions for killing rogue servers. Assumes that touching `src/server/router.js` will restart the server.
# Put this in ~/.config/fish/functions/.
function unstick
kill -9 (lsof -ti :$argv[1]); and touch src/server/router.js
wearhere / HelloWorld.ract
Last active Feb 9, 2017
Backbone + Ractive + Rollup
View HelloWorld.ract
<h1>Hello, {{ titlecase(name) }}</h1>
wearhere / HandlebarsHelpers.js
Last active Feb 9, 2017
Backbone + Handlebars + Rollup
View HandlebarsHelpers.js
export default function(Handlebars) {
Handlebars.registerHelper('titlecase', (string) => {
if (!string) return string;
return string[0].toUpperCase() + string.slice(1);
View index.js
var rollup = require('rollup');
var handlebars = require('rollup-plugin-handlebars-plus');
var nodeResolve = require('rollup-plugin-node-resolve');
// This can be whatever as long as it's consistent below.
var jqueryModuleId = 'jquery';
entry: 'main.js',
external: [jqueryModuleId],
You can’t perform that action at this time.