Skip to content

Instantly share code, notes, and snippets.

View brianberlin's full-sized avatar
⚜️

Brian Berlin brianberlin

⚜️
View GitHub Profile
@brianberlin
brianberlin / views-view-grid.tpl.php
Created June 26, 2012 17:34 — forked from berkes/views-view-grid.tpl.php
Drupal grid view template for omega theme.
<?php
/**
* @file views-view-grid.tpl.php
* Default simple view template to display a rows in a grid.
*
* - $rows contains a nested array of rows. Each row contains an array of
* columns.
*
* @ingroup views_templates
*/
@brianberlin
brianberlin / index.js
Last active August 29, 2015 14:06
requirebin sketch
var State = require('ampersand-state'),
moment = require('moment');
/*
* Example of being able to use anything as type without warning.
*/
var TestState = State.extend({
props: {
@brianberlin
brianberlin / index.js
Last active August 29, 2015 14:06
requirebin sketch
var AmpersandModel = require('ampersand-model');
var Model = AmpersandModel.extend({
urlRoot: '/api/model',
props: {
url: { type: 'string' },
}
});
var model = new Model();
@brianberlin
brianberlin / index.js
Created September 27, 2014 03:42
requirebin sketch
var View = require('ampersand-view'),
domReady = require('domready');
var MyView = View.extend({
el: document.body,
template: "<div><div data-hook='last-clicked'></div><a data-hook='test1'>Test 1</a><a data-hook='test2'>Test 2</a></div>",
events: {
'click [data-hook=test1]': 'testOne',
'click [data-hook=test2]': 'testTwo',
},
@brianberlin
brianberlin / index.js
Created October 21, 2014 20:32
requirebin sketch
var Router = require('ampersand-router');
module.exports = Router.extend({
routes: {
'home': 'auto',
'about': 'auto',
'signup': 'auto',
'login': 'auto',
'blog': 'blogIndex',
'blog/new': 'blogAddArticle',
@brianberlin
brianberlin / index.js
Last active August 29, 2015 14:09
requirebin sketch
var Model = require('ampersand-model'),
Collection = require('ampersand-collection');
var ImageModel = Model.extend({
props: {
id: { type: 'number' },
path: { type: 'string' }
}
});
@brianberlin
brianberlin / index.js
Created November 14, 2014 14:43
requirebin sketch
var Model = require('ampersand-model'),
Collection = require('ampersand-collection');
var SubSubSubModel = Model.extend({
props: {
text: { type: 'string' }
}
});
var SubSubModel = Model.extend({
@brianberlin
brianberlin / index.js
Last active August 29, 2015 14:09
requirebin sketch
var Model = require('ampersand-model').extend(),
Router = require('ampersand-router').extend(),
View = require('ampersand-view').extend(),
RestCollection = require('ampersand-rest-collection').extend(),
reserved = [];
getReservedNames(new Router());
getReservedNames(new Model());
getReservedNames(new View());
getReservedNames(new RestCollection());
@brianberlin
brianberlin / index.js
Created January 15, 2015 21:49
requirebin sketch
var Collection = require('ampersand-collection'),
Model = require('ampersand-state'),
View = require('ampersand-view');
var Person = Model.extend({
props: {
id: { type: 'number' },
name: { type: 'string' }
}
});
@brianberlin
brianberlin / index.js
Created March 3, 2015 21:10
requirebin sketch
var Model = require('ampersand-model'),
Collection = require('ampersand-collection');
 
var Picture = Model.extend({
urlRoot: '/picture',
props: {
path: { type: 'string' }
},
derived: {
hasPath: {