Skip to content

Instantly share code, notes, and snippets.

View jasonrhodes's full-sized avatar

Jason Rhodes jasonrhodes

View GitHub Profile
@jasonrhodes
jasonrhodes / backbone-wtf.markdown
Last active August 29, 2015 13:55
How I finally understood how to use Backbone in a real project.

Project files: https://github.com/johnshopkins/roy-gbiv

  • Models with individual model views, ie a color model with a "color wedge" view
  • Collections with collection views that build their collected models using the model view, ie a palette collection made up of colors and a "color wheel" collection view that assembles its color models using the color wedge view into a wheel
  • Use Common JS "require()" to keep files separate
js/
    app/
 collections/
@jasonrhodes
jasonrhodes / pcmalware.markdown
Last active August 29, 2015 13:55
Fixing a malware-riddled PC, try this.

Having problems with your awful PC being crushed by malware? Try these steps:

  1. Restart your computer in "SAFE MODE with networking"

    • Restart
    • When the computer is first turning back on, press F8 repeatedly
    • A screen should appear allowing you to select a mode
    • Push the "down" arrow until you highlight "Safe Mode with Networking"
    • Push enter
  2. In this folder, double click rkill, and let it run

@jasonrhodes
jasonrhodes / wtf-di.markdown
Last active August 29, 2015 13:56
Testing dilemma

I'm writing tests for some small JavaScript libraries. In one small library I have a few "classes":

// lib/ChordMaker.js
var wheel = require("./wheel");

var Maker = function (options) {
    // ...
};
@jasonrhodes
jasonrhodes / flickr-photo.html
Created February 9, 2014 14:02
Quick underscore-style template for a Flickr photo URL (see: http://www.flickr.com/services/api/misc.urls.html)
<img src='http://farm<%= farm %>.staticflickr.com/<%= server %>/<%= id %>_<%= secret %>_{s|q|t|m|n|z|c|b|o}.jpg'>
@jasonrhodes
jasonrhodes / gulp-way.markdown
Created February 20, 2014 19:44
Draft: The gulp way of task management

Explain what makes gulp different, who it's for, and how to get started while avoiding common pitfalls that show up in the issue queue and stack overflow.

@jasonrhodes
jasonrhodes / gulpfile.js
Created March 9, 2014 19:10
Trying to figure out how to interact with files in a gulp glob.
var through = require("through");
var fs = require("fs");
function write(file) {
console.log(file);
console.log(file.toString());
}
gulp.task("move", function () {
@jasonrhodes
jasonrhodes / nygwp-midwest-notes.markdown
Last active August 29, 2015 13:57
Notes and resources from my talk: "Not Your Grandmother's WordPress", given at Midwest PHP 3/15/2014

Notes for a responsive design talk or blog post I've been crafting in my head for over a year

Responsive design begs you to find the lowest common denominator to limit the amount of work you need to do across breakpoints. Ex. hover state: why maintain hover states AND 2-stage clicks for mobile, why not just make everyone use the 2-stage click method to keep it simple? Or why expose the navigation on desktop only to hide it on mobile when we can make the experience consistent and just use the menu icon in all places, decluttering the desktop experience as well?

LCD design has consequences.

@jasonrhodes
jasonrhodes / callbacklife.js
Created March 30, 2014 02:45
Demonstrating how to think in callbacks for someone in IRC
var request = require('request');
var cheerio = require('cheerio');
var express = require('express');
var app = express();
app.use(express.logger());
var leagues = { ambush: '506' };
//request(forum_url(league, page), get_forum_threads);
@jasonrhodes
jasonrhodes / enhanceftw.markdown
Last active August 29, 2015 13:57
I AM DOING ENHANCING

How to enhance, progressively

Take something small and dumb like this:

<img src="my-image.jpg" />

and ENHANCE it with SUPERNESS, like this: