Skip to content

Instantly share code, notes, and snippets.

@bernharduw
bernharduw / list-item.js
Last active December 7, 2016 02:24 — forked from casesandberg/list-item.js
reactcss playground
import React from 'react';
import styled from 'styled-components';
const Item = styled.div`
margin-top: 1px;
padding: 15px;
background: #333;
${({first}) => first ? `
margin-top: 0;
(function(window, undefined){
window.Document = Backbone.Model.extend({
url: function () {
var self = this,
base = '/' + self.database;
if (self.isNew())
@bernharduw
bernharduw / index.js
Created January 28, 2015 22:56
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Rebuild to run it on the right
var Collection = require('ampersand-rest-collection');
var AmpersandModel = require('ampersand-model');
var Gallery = Collection.extend({
model: function(attr) {
return new Gallery();
},
@bernharduw
bernharduw / index.js
Last active August 29, 2015 14:14
Possible solution to create a nested Gallery model with Ampersand.js
var Collection = require('ampersand-rest-collection');
var AmpersandModel = require('ampersand-model');
var Gallery = Collection.extend({
model: function(attr) {
return new Gallery();
},
isModel: function(model) {
return model instanceof Gallery;
@bernharduw
bernharduw / index.js
Created January 28, 2015 18:42
requirebin sketch
var ViewSwitcher = require('ampersand-view-switcher');
var View = require('ampersand-view');
var domready = require('domready');
var V = View.extend({
template: '<div>Hello View Switcher!</div>'
});
domready(function () {
var v = new V();
// /common/core/ampersand-input-view-dust.js
/**
* Extends the Ampersand InputView class to make it work with Dust templates
*/
/*global dust*/
var InputView = require('ampersand-input-view');
var InputViewDust = InputView.extend({
template: 'includes.formInput',
render: function () {
var self = this;