This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Copies the docs over to the website repository and commits it | |
folder_name=${PWD##*/} | |
LAYOUT_PREFIX='---\r\nlayout: default\r\n---\r\n\r\n' | |
mkdir -p "../chip-js.github.io/docs/$folder_name" | |
if [ -d "docs" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Model() { | |
var constructor = function(props) { | |
Object.keys(props).forEach(function(key) { | |
this[key] = props[key]; | |
}, this); | |
}; | |
constructor.prototype = Object.create(Model.prototype); | |
constructor.prototype.constructor = constructor; | |
return constructor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Class() {} | |
Class.extend = extend; | |
module.exports = Class; | |
function extend(Subclass, prototype) { | |
// Support no constructor | |
if (typeof Subclass !== 'function') { | |
prototype = Subclass; | |
var SuperClass = this; | |
Subclass = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add aliases for the bindings to use brackets, e.g. bind-value becomes [value] | |
chip.Binding.bindings.slice().forEach (binding) -> | |
name = binding.name | |
return if name.indexOf('-*') >= 0 | |
if binding.name.indexOf('bind-') is 0 || binding.name.indexOf('attr-') is 0 | |
name = '[' + name.replace(/^(bind|attr)-/, '') + ']' | |
chip.binding name, binding.priority, binding.handler | |
else if binding.name.indexOf('on-') is 0 | |
name = '(' + name.replace(/^on-/, '') + ')' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Required modules. | |
var cradle = require('cradle'); | |
var util = require('util'); | |
var http = require('http'); | |
// Config. | |
var config = require('./config'); | |
// Create a new HTTP server to accept Postmark POSTs. | |
http.createServer(function(req, res) { |
NewerOlder