Skip to content

Instantly share code, notes, and snippets.

@cdaringe
cdaringe / index.js
Last active August 29, 2015 14:14
requirebin sketch
var View = require('ampersand-view');
var ViewSwitcher = require('ampersand-view-switcher');
var domready = require('domready');
var MySubView = View.extend({
props: { data: 'string'},
template: [
'<div>',
'<span>suuuper subview</span><br/>',
'<div data-hook="data"></div>',
@cdaringe
cdaringe / index.js
Last active August 29, 2015 14:15
requirebin sketch
var FormView = require('ampersand-form-view');
var SelectView = require('ampersand-select-view');
var MyForm = FormView.extend({
validCallback: function (valid) {
if (valid) {
console.log('The form is valid!');
} else {
/**
* THIS IS EXECUTED on first render
@cdaringe
cdaringe / configuration.h
Created February 17, 2015 12:17
cOssel configuration.h
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
// This configuration file contains the basic settings.
// Advanced settings can be found in Configuration_adv.h
// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
@cdaringe
cdaringe / index.js
Created February 24, 2015 20:36
requirebin sketch
var State = require('ampersand-state');
var MyState = State.extend({
props: {
myDate: {
type: 'date',
default: null
}
}
});
@cdaringe
cdaringe / index.js
Created February 25, 2015 16:20
requirebin sketch
var State = require('ampersand-state');
var MyState = State.extend({
props: {
myDate: {
type: 'date',
default: null
}
}
});
@cdaringe
cdaringe / index.js
Created February 25, 2015 16:20
requirebin sketch
var State = require('ampersand-state');
var MyState = State.extend({
props: {
myDate: {
type: 'date',
default: null
}
}
});
@cdaringe
cdaringe / index.js
Last active August 29, 2015 14:16
requirebin sketch
var Collection = require('ampersand-collection');
var data = [
{
a: 'a',
b: 'auntie t\s'
}, {
a: 'b',
b: 'supreme'
}, {
a: 'c',
@cdaringe
cdaringe / index.js
Created March 6, 2015 20:04
requirebin sketch
var FormView = require('ampersand-form-view');
var InputView = require('ampersand-input-view');
var formEl = document.createElement('form');
formEl.id = 'myForm';
var inputContainer = document.createElement('div');
inputContainer.id = 'inputContainer';
formEl.appendChild(inputContainer);
@cdaringe
cdaringe / index.js
Created March 11, 2015 06:06
requirebin sketch
var State = require('ampersand-state');
var MyState = State.extend({
props: {
myDate: {
type: 'date',
default: null
}
}
});
@cdaringe
cdaringe / gist:2aa1dac555a0a6cb4c79
Last active August 29, 2015 14:18
select-view-diff
diff --git a/ampersand-select-view.js b/ampersand-select-view.js
index 8b08777..becb863 100644
--- a/ampersand-select-view.js
+++ b/ampersand-select-view.js
@@ -42,6 +42,7 @@ function SelectView (opts) {
this.startingValue = opts.value;
this.yieldModel = (opts.yieldModel === false) ? false : true;
+ this.eagerValidate = opts.eagerValidate;
this.required = opts.required || false;