Skip to content

Instantly share code, notes, and snippets.

View bingeboy's full-sized avatar
🏠
Working from home

JP McGarrity bingeboy

🏠
Working from home
View GitHub Profile
@iest
iest / readme.md
Created November 29, 2016 18:26
How we went from css modules & sass to glamor

We started out with sass files with something like this (obvious brevity is obvious):

// colors.scss
$green: #37ab2e;
$white: #FFFFFF;

// skin.scss
.bg_green { color: $green; }
.fg_white { color: $white; }
@haroldtreen
haroldtreen / promise-test.js
Last active August 25, 2023 13:59
Testing promise rejection with Mocha
const { assert } = require('chai');
function isError(e) {
if (typeof e === 'string') {
return Promise.reject(new Error(e));
}
return Promise.resolve(e);
}
@bingeboy
bingeboy / payloadfs.js
Last active January 20, 2016 21:17
write a payload from flux to temp folder
/////////////////////////////////////////////////////////////////////////////////////
// TEST CODE FOR PAYLOAD DATA CREATION
/////////////////////////////////////////////////////////////////////////////////////
var fs = require('fs');
var fileName = '/tmp/results.json';
fs.writeFile( fileName, JSON.stringify(res.body, null, 4), function (error) {
if (error) {
console.log(error);
} else {
console.log('JSON saved to temp dir: ', fileName);
@cvrebert
cvrebert / css_regression_testing.md
Last active May 28, 2024 17:42
Survey of screenshot-based CSS testing tools

Currently considering https://github.com/webdriverio/webdrivercss


Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots

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!)
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@ahx
ahx / hoodie_adapter.js
Last active March 15, 2018 19:52
A ember-model adapter for hoodie.js. Hoodie: http://hood.ie ember-model: https://github.com/ebryn/ember-model
// Usage:
// HoodieAdapter.create({type: "mystuff", url: "some/url"})
// "type" is required. "url" is optional.
var hoodie,
get = Ember.get,
Promise = Ember.RSVP.Promise;
function mustImplement(message) {
var fn = function() {
@mikeal
mikeal / gist:6084298
Last active December 20, 2015 06:18
Been rather busy....

Because I've been so busy lately I haven't really had a chance to talk about anything I've built or been using, but i've been publishing so many new modules it's worth going back over.

Real quick, Getable is a mobile/desktop ordering and fullfillment application for commercial construction. Think mobile amazon/ebay for large construction jobsites.

First off, everything is realtime, using engine.io with everything but long polling turned off. We tried leaving websockets on but there were some nasty bits that made the connection die and not come back on iPhone which we just couldn't debug in time so we turned it off.

Engine.io is a great module as it just provides a simple duplex stream-like (more on this later) interface that upgrades itself when available. This meant that in order to get some use out of it I had to write a few modules.

eiojson sends JSON messages rather than strings bidirectiona