Skip to content

Instantly share code, notes, and snippets.

View basham's full-sized avatar

Chris Basham basham

  • Indiana University
  • Bloomington, Indiana
  • 04:15 (UTC -05:00)
View GitHub Profile
@felixgirault
felixgirault / noUiSliderA11y.js
Last active May 18, 2018 22:34
Accessible noUiSlider
/**
* Adds an accessibility layer to the default noUiSlider.
*
* @see $.fn.noUiSlider()
*/
$.fn.noUiSliderA11y = function(options, rebuild) {
var slider = this;
if (!('noUiSlider' in slider)) {
throw new Error('noUiSlider is not loaded.');
@Willmo36
Willmo36 / Rx.Observable.fromSuperagent.es6
Last active July 21, 2016 19:03
RxJS stream from SuperAgent request
let Rx = require("rx");
Rx.Observable.fromSuperagent = request => () => Rx.Observable.create(observer => {
request.end((err, res) => {
if (err) {
observer.onError(err)
} else {
observer.onNext(res);
}
observer.onCompleted();
@gpbl
gpbl / reflux-master-detail.md
Last active November 3, 2015 13:19
Using Reflux stores and actions for a Master/Detail app with React

Reflux stores and actions in a Master/Detail app

Example and reasonings when using Reflux stores and actions for a Master/Detail app with React – with an eye to server-side rendering. Some concepts apply to reflux#166 and reflux#180.

Requirements

Must work with a router

This hypotetical app would use a router to display a list of items (e.g. at the url example.org/items, the master view) and a single item (e.g. example.org/items/:id, the detail view).

@mathisonian
mathisonian / index.md
Last active August 10, 2024 20:59
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

@dandean
dandean / link.sh
Last active August 29, 2015 14:04
Link a module to itself to get around relative require hell.
@staltz
staltz / introrx.md
Last active January 15, 2026 06:27
The introduction to Reactive Programming you've been missing

Prerequisites and assumed conditions

  • Mac OS X 10.9.2
  • Clean install
  • Admin user (required to install Xcode cli dev tools, Virtualbox application)
  • Network connection

Installation

CLI tools Needed:

@jonschlinkert
jonschlinkert / 1. handlebars-subexpression.html
Last active February 3, 2018 05:51
Very powerful combination! Four helpers are used here: `each`, `expand`, `markdown` and `inline`.
{{#each (expand 'content/*.md')}}
{{#markdown}}
{{inline .}}
{{/markdown}}
{{/each}}
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),