Skip to content

Instantly share code, notes, and snippets.

View wilsonpage's full-sized avatar

Wilson Page wilsonpage

View GitHub Profile
define(['moduleA.js'], function(ModuleA){
return {
"test1": function (test) {
// run test on ModuleA
},
"test2": function (test) {
// run test on ModuleA
},
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1")
title= title
link(rel='stylesheet', href='/public/js/libs/qunit/qunit.css')
script(src="/public/js/libs/qunit/qunit.js")
script(data-main="/public/js/app-test", src="/public/js/libs/require/require.js")
@wilsonpage
wilsonpage / router.js
Created November 26, 2011 12:32
Example router module
define([
'jQuery',
'Underscore',
'Backbone',
'modules/feed',
'modules/files',
'modules/members',
'modules/misc/GBL',
'modules/misc/lightbox'
], function($, _, Backbone, Feed, Files, Members, GBL, Lightbox){
@wilsonpage
wilsonpage / router.js
Created November 26, 2011 12:30
Example router
// ROUTES
var Routes = Backbone.Router.extend({
// Route Definitions
routes: {
'' : 'feed',
'feed' : 'feed',
'files' : 'files',
'members' : 'members',
':view/:itemID' : 'viewItem',
@wilsonpage
wilsonpage / router.js
Created November 26, 2011 12:31
Example router
// ROUTES
var Routes = Backbone.Router.extend({
// Route Definitions
routes: {
'' : 'feed',
'feed' : 'feed',
'files' : 'files',
'members' : 'members',
':view/:itemID' : 'viewItem',
@wilsonpage
wilsonpage / updateDuplicateData.js
Created December 3, 2011 14:46
This function is run when a user changes any of their core data to update duplicates across the database.
/**
* 'UpdateDuplicateData'
*
* Used to update user data on all models that it is duplicated on
*
* @param {object} User The main user model
* @param {object} changes An object containing the changed user attributes
* @param {Function} cb Callback - function(err){}
*
*/
@wilsonpage
wilsonpage / print_r.js
Created December 6, 2011 16:13
print_r() for javascript
(function($){
$.print_r = (function(){
var depth = 0;
var render = function(o){
var str='',
indent = (function(){
var res="";
for(var i=0; i<depth*4; i++){ res+='&nbsp;' };
return res;
@wilsonpage
wilsonpage / Makefile
Created December 8, 2011 17:22
My first Makefile
#========================================
# Static Asset Build Makefile
#
# Author: Wilson Page
#========================================
# Shortcuts
build-tools = build/tools/
css-dir = static/css/
@wilsonpage
wilsonpage / overlays.css
Created February 3, 2012 09:56
Testing
.overlay {
background: #333;
border: solid 1px;
border-color: #666 #222 #111 #555;
border-radius: 10px;
box-shadow:
0px 0px 18px rgbA(0,0,0,0.28),
1px 1px 6px rgbA(0,0,0,0.2),
inset 0px 3px 6px rgbA(255,255,255,0.1);
}
@wilsonpage
wilsonpage / overlays.css
Created February 3, 2012 09:57
This us my description
#overlay-container {
display: none; /* hidden by default */
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
-webkit-box-orient: horizontal;