Skip to content

Instantly share code, notes, and snippets.

View isochronous's full-sized avatar

Jeremy McLeod isochronous

  • DataScan
  • Atlanta, GA
View GitHub Profile
@isochronous
isochronous / gist:9b07abbd9bb2caeb3b402cc67b08deb5
Last active November 13, 2024 20:24
Factorio Space Age Minimal Space Science Platform 98/sec
0eNrtXNtu2zgQ/ZVCjwt5lzcpdrDdn+hjEAiyRTdEdXF1cRsU/vcd6mIpjuxKPkkvQZ9CS5rRcHjODDmk8s1Zx5Xe5SYtndtvjtlkaeHc3n1zCvMxDWN7LQ0T7dw6xS7c6EWxMTqlv/Tjk3NwHZNG+qtzyw/3rqPT0pRGN/L1j8cgrZK1zukBt9OjY70pc7NZbKs8JZWO6+yyggSz1L6NlC3E357rPFLD/9uz7yh10ig10RODtI4WSRZVsXb6x+ipNDDpngzI8sdGrP+lXKcore3W5MPBPdGpt1tT9/CxVbwQV6hmVvW9VX7iBXH0QliUOs9MtNhksXVIlj/3A3vqBhqaMs/iYK0fwr0hAXpqY/JNZcqg0GWwNTHpJDPLvNLu8VauwyiwsmRLe5OU5bqo4nIxMD+t4njEZHk0ucjiMKeBT3X83FY5tHVEjZqmZuF1erxxPd5Rj0VqGaYleTBZmzQcdeHiaJc668OC3G9q2A/b9dg22Hado2ufXG0NSXQZxjEBuh/Thyr9RMZ8rsKYjKdn0ixPQttfMnYX5rWxt877+kJlqcdZjcVGdw+TTZivs/QldffjmX01kcYUrwjlBPWRcfKPrzFpoXN6xyWeN4MTmbxxv3O7/I7PTZ6liyzXk+y1sakq9FOCjNh8c1S/Ja8sLhjOvo+qs8w8TDNmOcWBfLodOg3XsY5OowOJREeVW5MXZPFp5K+dvYvDsg6zHe8Ipoyd+PpfZxQMqz7s5aZ8IMIQoi/Rlp+BhRrvY6+1708x1qHycWet2Ju8rGqkdDGpfmKhw82D7SJFAVIT9D1dkEHZTlM3azOcv0g0q8pdNVv5qH84mxfV/gS1nxPUOJ83Tufjm/ozaj9u1ObNuuwMphk1cTpqVtPPmYVxOTeEWsw13ZCHNxo11VyfvH2XeLOgfh7p6qcB3Z88CTuOJod5OnFOxm/mG8eeuXZM8XJeYjnR/hqp5EXCvRjNJC+SpcQrJRJ1Po+spo7+eWSq1wGmYAPeFzpZxyb9uEgoUJh
@isochronous
isochronous / gulpfile.js
Last active May 2, 2016 10:13
The gulpfile we use for our webapp-in-android-app project
var gulp = require('gulp'),
// Used to process `include` statements in source files
includer = require('gulp-includer'),
// Compiles SASS files using LibSass
sass = require('gulp-sass'),
// Renames files in the file stream
rename = require('gulp-rename'),
// JavaScript minifier
uglify = require('gulp-uglify'),
// Filter files out of the vinyl stream
@isochronous
isochronous / comparatorGenerator.js
Created May 22, 2015 22:25
A client-side comparator generating function for Backbone collections
/**
* This method creates a new comparator function that should correctly sort by the right field in the correct order
* assuming the sorting is specified by a single field with a "attributeName-asc/desc" format. Add as a change handler
* for your sortBy field, add `this.on('sync', this.sort)` to the collection, and you're ready to go.
* @param {Backbone.Model} model
* @param {string} newSortBy
* @deprecated
*/
updateCollectionComparator: function(model, newSortBy) {
var theCollection = this.someCollection, // change this line
@isochronous
isochronous / chosen.jquery.js
Created April 29, 2015 17:52
Chosen with fix to update classNames and title from select on update. Prototype version is a separate file below the jQuery version.
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.4.2
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2015 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
@isochronous
isochronous / jQueryUI Widget Skeleton.js
Created April 27, 2015 23:48
jQueryUI Widget Skeleton (basic comments only)
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(root.jQuery);
}
}(this, function ($) {
@isochronous
isochronous / jQueryUI-Widget-Skeleton-Integrated-Docs.js
Last active August 29, 2015 14:20
jQueryUI Widget Skeleton (integrated documentation)
// Use AMD loader if present, if not use global jQuery
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(root.jQuery);
}
}(this, function ($) {
@isochronous
isochronous / Example widget code
Created September 13, 2013 18:49
This is just a widget I wrote (won't have any meaning outside of the project I'm working on) that I put up to show an example of how I write jQuery widgets, and contains some optimizations to make it as performant as possible by minimizing DOM operations.
define([
'jquery',
'underscore',
'text!./skeletonMarkup.html',
'jqueryui/widget',
'jqueryui/sortable',
'jqueryui/spinner'
], function ($, _, markup) {
'use strict';
@isochronous
isochronous / paths2object
Last active December 20, 2015 12:59
convert a flat object with namespaced keys to a heirarchical object
/**
* Converts a "flat" object with namespaced keys into a hierarchical object
* @param {object} flat - A "flat" object with namespaced keys to turn into a hierarchical object
* @returns object - the hierarchical object
*/
var _paths2obj = function (flat) {
var root = {},
keys = _.keys(flat),
parts, entry, currentPart, pointer, i, il;
@isochronous
isochronous / jquery.ui.toggle-switch.js
Last active December 12, 2015 06:49
taitems toggleswitch converted to AMD-compliant widget
/**
* jQuery UI Toggle Switch
*
* http://taitems.tumblr.com/post/17853682273/jquery-ui-toggleswitch-ux-lab-005
*
* Depends:
* jquery.ui.slider.js
*/
(function (factory) {
if (typeof exports === 'object') {
@isochronous
isochronous / gist:4439430
Last active December 10, 2015 13:08
register a region with a marionette sub-app after root app instantiation
// This code assumes you start all your sub-apps during the root-app's init
// phase. If not, this same logic can be bound to a different event (ex. start).
rootApp.on("initialize:after", function () {
vent.trigger("system:default:region:set", rootApp.body);
});
// Then in some other sub-application
define([
'marionette',
'mysupervent'