Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
brianjmiller / .gitignore
Last active Dec 19, 2015
Simple service based on Express
View .gitignore
/node_modules
@brianjmiller
brianjmiller / gist:5814668
Last active Dec 18, 2015
PR template for browser testing
View gist:5814668
Tested in:
- [ ] Node.js
- [ ] Chrome
- [ ] FireFox
- [ ] Safari
- [ ] IE 11
- [ ] IE 10
- [ ] IE 9
- [ ] IE 8
@brianjmiller
brianjmiller / require.config.js
Last active Dec 16, 2015
Loading CryptoJS with require/almond, etc.
View require.config.js
var CryptoJS = CryptoJS || (function (Math, undefined) {^M
^M
return C;^M
}(Math));^M
define("cryptojs", (function (global) {
return function () {
var ret, fn;
return ret || global.CryptoJS;
};
@brianjmiller
brianjmiller / gist:4946347
Created Feb 13, 2013
Sample TinCanJS usage
View gist:4946347
TinCan.enableDebug();
var tincan = new TinCan (
{
recordStores: [
{
endpoint: "https://cloud.scorm.com/ScormEngineInterface/TCAPI/public/",
auth: "" // Base64 encoded string that looks like "test:password"
}
]
View gist:4757128
Y.io(
"/pdl/api/guest/user",
{
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
data: Y.JSON.stringify(
{
View gist:4185943
var Clazz = Y.namespace("OCLC.W.Cart.ML.Lines").Base = Y.Base.create(
"oclc-cart-ml-lines-base",
Y.ModelList,
[],
{
model: Y.OCLC.W.Cart.M.Line.Base,
initializer: function () {
Y.log("initializer", "debug", Clazz.NAME);
@brianjmiller
brianjmiller / build.js
Created Sep 14, 2012
Trying to get Gear to work
View build.js
#!/usr/bin/env node
var gear = require('gear');
new gear.Queue(
{
registry: new gear.Registry(
{
module: 'gear-lib'
}
@brianjmiller
brianjmiller / gist:3667321
Created Sep 7, 2012 — forked from ericf/gist:3666772
Using Y.ModelConsumer
View gist:3667321
// assumes existence of Y.UserModel
YUI.add('user-view', function (Y) {
Y.UserView = Y.Base.create('userView', Y.View, [ Y.ModelConsumer ], {
template: Y.Handlebars.templates['user'],
initializer: function () {
var user = this.get('user');
View general.js
YUI.add(
"myapp-general",
function (Y) {
var Clazz = Y.namespace("MyApp").General = Y.Base.create(
"myapp-general",
Y.Widget,
[],
{
initializer: function (config) {
Y.log("initializer", "debug", Clazz.NAME);
@brianjmiller
brianjmiller / gist:2206497
Created Mar 26, 2012
Circular Class Definition
View gist:2206497
YUI.add(
"custom-manage-m-supplier",
function (Y) {
var Clazz = Y.namespace("Bikes.Manage.M").Supplier = Y.Base.create(
"custom_manage_m_supplier",
Y.Bikes.Manage.M.Base,
[ Y.ModelRelate, Y.ModelRelateAutoGen ],
{},
{
ATTRS: {