Skip to content

Instantly share code, notes, and snippets.

View HenrikJoreteg's full-sized avatar

Henrik Joreteg HenrikJoreteg

View GitHub Profile
@HenrikJoreteg
HenrikJoreteg / index.js
Created June 5, 2014 21:04
requirebin sketch
// we'll just use an ampersand-view here as an
// example parent view
var View = require('ampersand-view');
var FormView = require('ampersand-form-view');
var InputView = require('ampersand-input-view');
var MyView = View.extend({
template: '<div><h1>App form</h1 ><form role="app-edit-form"></form></div>',
render: function () {
@HenrikJoreteg
HenrikJoreteg / parent-model.js
Created July 15, 2014 22:03
How you might do a subview for a child model property
var Model = require('ampersand-model');
module.exports = Model.extend({
props: {
address: 'state'
}
});
@HenrikJoreteg
HenrikJoreteg / body.jade
Created July 21, 2014 21:21
Jade template for wolves app
body
nav.navbar.navbar-default
div.container-fluid
div.navbar-header
a.navbar-brand(href='/') Our App
ul.nav.navbar-nav
li
a(href='/list') list
.container
main(role="page-container")
@HenrikJoreteg
HenrikJoreteg / options.js
Created September 5, 2014 02:59
Nested models in Ampersand.js
// credit for this goes to @latentflip
var State = require('ampersand-state');
var Collection = require('ampersand-collection');
var OptionList = Collection.extend({
//Circular reference so we have to function wrap this
model: function (data, options) {
return new Option(data, options);
}
@HenrikJoreteg
HenrikJoreteg / index.js
Created February 27, 2015 19:26
requirebin sketch
var AmpersandView = require('ampersand-view');
var PersonRowView = AmpersandView.extend({
template: "<h2>This is the first ampersand View </h2>"
});
var personView = new PersonRowView()
personView.render();
document.body.appendChild(personView.el);
@HenrikJoreteg
HenrikJoreteg / notes.md
Last active August 29, 2015 14:16
Ampersand Core Syncup - March 12, 2015

Ampersand Core Meeting 3/12/2015

present:

  • Gar
  • Henrik
  • Philip

Updates

  • WhatsApp is using Ampersand and React in their web app. They saw me tweet about it the official React twitter account retweeted it too. Shortly thereafter I got a nice email some folks from WhatsApp thanking us for Ampersand and asking for an address to send a gift to, so that was fun.
@HenrikJoreteg
HenrikJoreteg / notes.md
Created March 26, 2015 16:20
Ampersand Core Syncup - March 26, 2015

Ampersand Core Syncup 3/26/2015

Present

Gar, Philip, Henrik

Discussed

  • amp/lodash blog post published, hopefully people feel like the switch is now "official" we can start to switch all the things to lodash.*
  • Consider making ampersand-cli generated site fully static and deployable to surge.sh. Remove/simplify moonboots from ampersand-cli app. At the time the tools were not there and were not that great. Now they are, let's simplify things.
  • Henrik requesting review of: https://github.com/henrikjoreteg/hjs-webpack as simplified mechanism to configure webpack (it's a bit of a pain)
  • We still need to publish ampersand-react mixin. (Henrik building something with it currently to give it go)
@HenrikJoreteg
HenrikJoreteg / notes.md
Created April 9, 2015 16:29
Ampersand Core Syncup 4/9/2015

Ampersand Core Syncup 4/9/2015

(Syncup happened via Chat this morning due to folks being busy)

News:

Gar:

@HenrikJoreteg
HenrikJoreteg / index.js
Last active August 29, 2015 14:22
requirebin sketch
var AmpersandModel = require('ampersand-model');
var Model = AmpersandModel.extend({
props: {
name: 'string',
greetingType: ['string', true, 'long']
},
derived: {
greeting: {
deps: ['name', 'greetingType'],
@HenrikJoreteg
HenrikJoreteg / simple_function_queue_runner.js
Created July 7, 2010 18:06
Simple function queue runner. Just pass me an array of functions and I'll execute them one by one at the given interval.
// Simple function queue runner. Just pass me an array of functions and I'll
// execute them one by one at the given interval.
run_queue = function (funcs, step, speed) {
step = step || 0;
speed = speed || 500;
funcs = funcs || [];
if (step < funcs.length) {
// execute function
funcs[step]();