Skip to content

Instantly share code, notes, and snippets.

View jameyquinn's full-sized avatar

James E Quinn IV jameyquinn

View GitHub Profile
@jameyquinn
jameyquinn / 0_reuse_code.js
Created March 26, 2014 13:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jameyquinn
jameyquinn / performance block
Created March 27, 2014 17:09
js high res performance timer
start = performance.now();
//code
console.log('add marker: ' + String(performance.now() - start) + 'ms');
rk.waitFor(
'Model:Base'
).then(function(ModelBase, app){
app.polygon = app.polygon || {};
var PolygonModel = app.polygon.PolygonModel = ModelBase.extend({
/**
* Location model used primarily for autofill results (but can be used
* anywhere.
@jameyquinn
jameyquinn / gist:60e72c742fafa61ef069
Last active August 29, 2015 14:01
CSS selector count
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@jameyquinn
jameyquinn / gist:8e2523b341e8d7eb70ec
Created May 15, 2014 18:45
j/locations/ia8wv5x2ZHmc6t2ap9KuGpd
{
has_photo: false,
sub_locations: [],
hotel_count: 1,
img_name: null,
region_name: "Tolima",
name: "Ibagué",
avg_rate: 0,
geometry: {
coordinates: [
@jameyquinn
jameyquinn / Grunt test work
Last active August 29, 2015 14:02
Grunt test work
//create a test module for app js files missing corresponding test modules
grunt test-backfill --spec-dir=tests/specs
//output backfill log, but don't write new files
grunt test-backfill --no-write
//run the spec.js
grunt test --verbose
//test the spec javascript
html{
background-color:grey;
}
.sample{
width:75px;
height:28px;
background-color:black;
padding:40px;
border: 15px solid white;
@jameyquinn
jameyquinn / .gitconfig
Created June 4, 2014 02:26
git config global
[core]
excludesfile = /Users/jquinn/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[alias]
st = status
@jameyquinn
jameyquinn / deps.txt
Last active August 29, 2015 14:02
9 module dependency tree
_base.js (Model:Filter)
Model:Base
Base
dependencies: [
Sync
Base
Cache
Base
util
]
import mapboxgl from 'mapbox-gl';
// FRAGILE: webpack failure to import css into javascript without explicit reference
import '../node_modules/mapbox-gl/dist/mapbox-gl.css';
import MapboxDraw from '@mapbox/mapbox-gl-draw';
import '../node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
const debounce = require("debounce");
// see webpack plugin for the R prefix while treeshaking
import R, {
compose,
contains,