Skip to content

Instantly share code, notes, and snippets.

View wrumsby's full-sized avatar
💭
what is this even

Walter Rumsby wrumsby

💭
what is this even
View GitHub Profile
@wrumsby
wrumsby / dabblet.css
Created November 26, 2013 20:19
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
font-family: sans-serif;
box-sizing: border-box;
}
.container {
@wrumsby
wrumsby / dabblet.css
Created August 29, 2013 20:27
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
font-family: "Open Sans", Arial, Helvetica, sans-serif;
font-size: 24pt;
}
@wrumsby
wrumsby / toUpperCase.js
Created July 21, 2013 08:54
AMD function
define([], function () {
'use strict';
return function (text) {
return text.toUpperCase();
};
});
@wrumsby
wrumsby / ticker.js
Created July 21, 2013 08:53
AMD constructor
define([], function () {
function Ticker () {
this.seed = 0;
}
Ticker.prototype = {
next: function () {
return this.seed++;
}
};
@wrumsby
wrumsby / tick.js
Created July 21, 2013 08:36
AMD Singleton
define([], function () {
'use strict';
var i = 0;
return {
next: function () {
return i++;
}
};
@wrumsby
wrumsby / yui_config.js
Created July 20, 2013 10:58
Shimming 3rd party libs with YUI Loader.
YUI.applyConfig({
groups: {
'cdnjs': {
base : '//cdnjs.cloudflare.com/ajax/libs',
modules: {
'moment' : {
path: '/moment.js/2.0.0/moment.min.js'
}
}
}
@wrumsby
wrumsby / require-config.js
Last active December 20, 2015 00:49
RequireJS shim configuration.
require.config({
...
shim: {
'backbone': {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
'underscore': {
@wrumsby
wrumsby / ModelStore.js
Last active December 19, 2015 22:29
ExtJS Model & Store.
Ext.define('My.ToDo.Model', {
extend: 'Ext.data.Model',
fields: [
{
name: 'description',
type: 'string'
},
{
name: 'isDone',
type: 'boolean'
@wrumsby
wrumsby / Template.js
Last active December 19, 2015 22:29
ExtJS XTemplate.
var toDoTpl = new Ext.XTemplate([
'<ul>',
'<tpl for=".">',
'<li class="todo <tpl if="isDone"> todo-done</tpl>">',
'{description:htmlEncode}',
'</li>',
'</tpl>',
'</ul>'
]);
@wrumsby
wrumsby / FormPanel.js
Created July 18, 2013 09:40
ExtJS FormPanel.
Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
url: '/register.aspx',
method: 'POST',
items: [
{
xtype: 'textfield',
name: 'username',
fieldLabel: 'Username'
}