Skip to content

Instantly share code, notes, and snippets.

View ianstormtaylor's full-sized avatar
🖖

Ian Storm Taylor ianstormtaylor

🖖
View GitHub Profile
@ianstormtaylor
ianstormtaylor / component.json
Created August 10, 2013 04:12
Easily make a GitHub pages site from the Readme file of a repo.
{
"name": "my-repo",
"dependencies": {
"chjj/marked": "*"
},
"scripts": ["index.js"],
"templates": ["Readme.md"]
}
void function() { //closure
var global = this
, _initKeyboardEvent_type = (function( e ) {
try {
e.initKeyboardEvent(
"keyup" // in DOMString typeArg
, false // in boolean canBubbleArg
, false // in boolean cancelableArg
, global // in views::AbstractView viewArg
<fieldset class="signup-form-name-field signup-form-text-field form-text-field form-field text-field">
<label for="name"
class="signup-form-text-field-label form-text-field-label form-field-label">Name</label>
<input type="text"
name="name"
placeholder="Enter your full name..."
class="signup-form-name-input signup-form-text-field-input form-text-field-input form-field-input">
</fieldset>
/**
* Modified `build` to encapsulate state in a `Build` object...
*/
Builder.prototype.build = function (fn) {
var self = this;
this.lookup.end(function (err, components) {
if (err) return fn(err);
self.build = new Build(components);
self.batch.end(function (err) {
var shorthands = require('./shorthands');
/**
* Mixin shorthands.
*/
for (var key in shorthands) Builder.prototype[key] = shorthands[key];
account-header
analytics-identify
avatar
avatar-metadata
data-volume-metadata
db-organization
db-project
db-user
external-nav
feature
form
new-organization-form
new-organization-page
new-project-form
new-project-page
no-script
page
signup-form
signup-page
slug
@ianstormtaylor
ianstormtaylor / Makefile
Last active August 29, 2015 14:02
This is the normal way that Duo tests would be created for modules. It's testing the logic inside the module itself, but it's not testing the actual "built" file.
build-test.js: index.js test.js
duo test.js > build-test.js
test: build-test.js
mocha build-test.js
@ianstormtaylor
ianstormtaylor / Makefile
Last active August 29, 2015 14:02
This is what we would do with Analytics.js tests, since we actually want to be testing the physical built file itself, we're actually a layer above Duo because we're trying to test the Duo build process, which normal module testing shouldn't concern itself with. Use `-` in filenames instead of `/` since Gist has limitations.
build: index.js
duo index.js --global analytics > analytics.js
test: index.js test-index.js
duo test-index.js > test-build.js
open test-index.html # which adds both builds via <script> tags