Skip to content

Instantly share code, notes, and snippets.

View jrburke's full-sized avatar

James Burke jrburke

View GitHub Profile
@jrburke
jrburke / gist:3056571
Created July 5, 2012 21:24
Wiring for jquery adapter
requirejs.config({
map: {
'*': {
'jquery': 'jquery-adapter'
},
'jquery-adapter': {
'jquery': 'jquery'
}
});
@jrburke
jrburke / config.js
Created November 8, 2012 05:55
RequireJS jQuery adapter approach
//Set up the adapter config, so that any module asking
//for jquery gets an adapter module that has modified
//jquery before other modules can use it.
//Needs RequireJS 2.0+ to work correctly
//More info on map config:
//http://requirejs.org/docs/api.html#config-map
requirejs.config({
map: {
'*': {
'jquery': 'jquery.adapter'
@jrburke
jrburke / volofile
Created November 15, 2012 18:56
volofile doing git submodule work on volo create
module.exports = {
onCreate: {
run: [
'git submodule init',
'git submodule update'
]
}
};
@jrburke
jrburke / DefaultRouter.js
Created November 21, 2012 19:40
wiring backbone views
//Store this file at CarePassMe/Controllers/DefaultRouter.js
define(['backbone', '../Collections/Course', '../Views/CourseList', '../Collections/Page', '../Views/Pages'],
function (Backbone, Course, CourseList, Page, Pages) {
//The default router for the application.
//If you wanted to keep the globals for use outside of requirejs modules,
//note the assignment as part of the return. Otherwise, if the globals
are not needed just return Backbone.Router.extend()...
// Filename: src/js/collections/store/ArticlesCollection.js
define([
'require',
'underscore',
'backbone',
'models/store/ArticleModel'
], function (require, _, Backbone, ArticleModel) {
var ArticlesCollection = Backbone.Collection.extend({
model: function () {
@jrburke
jrburke / gist:4949790
Last active December 13, 2015 17:39
Gaia email layer split
/*
Generated with a build that does:
main:
include: ["almond", "event-queue", "mailapi/same-frame-setup"]
account:
exclude: ['event-queue', 'mailapi/same-frame-setup']
include: ['mailapi/activesync/account']
@jrburke
jrburke / gist:5215284
Created March 21, 2013 18:11
gelam test run
[~/git/gaia-email-libs-and-more-jrburke(onlinedelay)]$ make clean
rm -rf data/deps
rm -rf node-transformed-deps
[~/git/gaia-email-libs-and-more-jrburke(onlinedelay)]$ make all-tests
mkdir -p node-transformed-deps
rsync -avL node-deps/addressparser node-transformed-deps
building file list ... done
addressparser/
addressparser/.git
addressparser/.gitignore
diff --git a/apps/email/js/ext/mailapi/activesync/configurator.js b/apps/email/js/ext/mailapi/activesync/configurator.js
index 38d7a5a..69fe6cb 100644
--- a/apps/email/js/ext/mailapi/activesync/configurator.js
+++ b/apps/email/js/ext/mailapi/activesync/configurator.js
@@ -2931,8 +2931,12 @@ ActiveSyncAccount.prototype = {
});
}
else { // ActiveSync 12.x and lower
+ var encoder = new TextEncoder('UTF-8');
+
@jrburke
jrburke / gist:5303319
Last active February 11, 2024 23:19
config calls to run tests.
//in test1.js
define({
paths: {},
deps: ['test/_', 'test/$', 'dep1', 'dep2'],
callback: function (_, $, dep1, dep2) {
//test dep1 and dep2 in here
}
});
//in test2.js
@jrburke
jrburke / gist:5550075
Created May 9, 2013 19:51
quick json loader plugin
define({
load: function (id, require, onload, config) {
if (config.isBuild) {
return onload();
}
var xhr = new XMLHttpRequest();
xhr.open('GET', id + '?bust=' + Date.now(), true);
xhr.send(null);
xhr.onreadystatechange = function (evt) {