Skip to content

Instantly share code, notes, and snippets.

@jeffgca
jeffgca / simple-server.js
Created February 17, 2014 19:03
A really simple web server, based on node-static.
#!/usr/bin/env node
var static = require('node-static');
var util = require('util');
if (!module.parent) {
var cwd = process.cwd();
var optimist = require('optimist');
var argv = optimist
@jeffgca
jeffgca / .jshintrc
Created March 2, 2014 06:13
My jshint configuration
{
"moz": true,
"browser": true,
"maxerr": 9999,
"trailing": true,
"loopfunc": true,
"globals": {
"loader": true,
"require": true,
"exports": true,
Handler function DebuggerClient.requester threw an exception: Error: 'delete' request packet has no destination.
Stack: DebuggerClient.prototype.request@resource://gre/modules/devtools/dbg-client.jsm:593:7
DebuggerClient.requester/<@resource://gre/modules/devtools/dbg-client.jsm:335:1
makeInfallible/<@resource://gre/modules/devtools/DevToolsUtils.jsm -> resource://gre/modules/devtools/DevToolsUtils.js:80:7
Breakpoints.prototype.removeBreakpoint/<@chrome://browser/content/devtools/debugger-controller.js:1928:7
resolve@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/promise.js:118:11
then@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/promise.js:43:43
then@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/core/promise.js:153:9
Breakpoints.prototype.removeBreakpoint@chrome://browser/content/devtools/debugger-controller.js:1926:5
Breakpoints.prototype._onEditorBreakpointRemove@chrome
### Keybase proof
I hereby claim:
* I am canuckistani on github.
* I am canuckistani (https://keybase.io/canuckistani) on keybase.
* I have a public key whose fingerprint is 4524 E274 7FDB 62FF 2F7B F7E7 0F93 F3EB D14D 3D55
To claim this, I am signing this object:
@jeffgca
jeffgca / Rooiboos.md
Last active August 29, 2015 13:59 — forked from anonymous/Rooiboos.md
Rooibos, or how I Infused some harmony into my webdev workflow

Excerpt

When I talk to people about tools for web development they say things like: "we have some old backbone stuff, did a few projects in Angular and Jerry wants to re-write everything in something called Ohm or Elm or Bazinga.js. We hate SASS, but we use it because we hate CSS more. We looked at gulp but we have too much magic in our Grunt files to convert! And I hate all debuggers because the framework we use has it's own ideas of what objects are. The tools are no help!"

What if you could create your own tools, and it was as simple as writing a web app using the tools and frameworks you're already using?

Description

This talk is a dive-in session on how I wrote my own Firefox developer tools extension called ‘Rooibos’ to run my unit tests automatically for me. The use case for Rooibos is simple: I’m looking at the site I’m working on and I want to run my tests and see what failed. Without switching to another app or anything. Turns out, it’s pretty easy these days to extend browsers to help w

@jeffgca
jeffgca / min-viable-gulp.js
Last active August 29, 2015 14:01
Minumum viable gulpfile.js - runs a static server, runs livereload, watches for all file changes.
/**
To install node dependencies:
npm install --save gulp gulp-livereload serve-static connect
To use liveReload, add this to your page:
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
@jeffgca
jeffgca / ST2_Firefox_Integration.md
Last active August 29, 2015 14:01
ST2 Intern Project

Sublime Text Support

MVP

For MVP we will focus on providing an ST2 plugin that allows the developer to edit files and communicate with Firefox in the following ways:

  • connect to Firefox over RDP
  • choose which tab I'm interested in interacting with
  • load stylesheets, scripts or document for a tab
  • If I make changes to a css file in sublime, those changes trigger live updates in Firefox or a connected device / runtime
No such property on self-hosted object: Number.isNaN(...) utils.js:509
13:12:15.295 error occurred while processing 'prototypeAndProperties: Error: No such property on self-hosted object: Number.isNaN(...)
Stack: ThreadActor.prototype.createValueGrip@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/script.js:2032:1
WCA_createValueGrip@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/webconsole.js:390:5
ObjectActor.prototype._propertyDescriptor@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/script.js:3403:7
ObjectActor.prototype.onPrototypeAndProperties@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/script.js:3191:7
DSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:1151:9
LocalDebuggerTransport.prototype.send/<@resource://gre/modules/devtools/dbg-c
@jeffgca
jeffgca / main.js
Created June 23, 2014 18:32
page-workr scraping example
let { Page } = require('sdk/page-worker');
let self = require('sdk/self');
let { ActionButton } = require("sdk/ui/button/action");
let worker = Page({
contentScriptFile: [self.data.url('worker.js'),
self.data.url('jquery.js')]
});
worker.on('fetched', function(data) {