Skip to content

Instantly share code, notes, and snippets.

@isao
isao / build.sh
Created December 13, 2012 17:19
`mojito build hybridapp` hacking for 0.5.x updating/fixing
#!/bin/sh -ex
appname=${1:-hybrid}
bldname=$appname-bld
statdir=yahoo.application.$appname
mojitodir=/Users/isao/Repos/mojito/myfork
pwd
mojito create app hybrid $appname
@isao
isao / example.js
Created December 20, 2012 01:04 — forked from jhs/example.js
// Short module explanation // Something to gather my thoughts
// // I think this looks cool.
//
module.exports = the_exported_function // Modules are a function. Always.
//
module.exports.extra = extra // Additional API entry points if
module.exports.other = other // desired.
//
var util = require('util') // Other packages from npm or core
var assert = require('assert') // No comma-first due to lots of
@isao
isao / index.js
Last active December 11, 2015 16:19
my sky pie psuedocode
var express = require('express'),
app = express(),
// starts with a set of paths, and optional env/fw/app rules to merge
config = require('./config/start')(process.argv, process.env);
locator = require('locator'),
foo = locator.bar(/* ?? */);
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@isao
isao / gist:5009030
Created February 21, 2013 22:36
yahoo/mojito/pull comment

current head of develop:

% cd examples/newsboxes
% mojito build html5app /tmp/nb
% grep rel= /tmp/nb/index.html
<link rel="stylesheet" type="text/css" href="static/Frame/assets/reset.css"/>
<link rel="stylesheet" type="text/css" href="static/Shelf/assets/shelf.css"/>

untested, but looks like adding the traing slash here will break these links

@isao
isao / index.js
Last active December 14, 2015 19:49
//require all .js files in __dirname
var fs = require('fs'),
resolve = require('path').resolve;
function reqone(filename) {
if(filename.match(/[.]js$/) && (filename !== __filename)) {
require(resolve(__dirname, filename));
}
}
@isao
isao / actions.js
Last active December 14, 2015 19:49
// side note: configs and routes can have YUI params, and actions can attach
// to a Y instance...
var fs = require('fs'),
path = require('path');
function appconfig(pathname, way, res) {
res.server.configs[way.parts.filename] = loadJson(pathname);
}
@isao
isao / gist.sh
Last active December 14, 2015 19:58
BBEdit Text Filter to create a gist from the current selection, using https://github.com/defunkt/gist
#!/bin/sh -e
tmp=/tmp/bbgist.tmp
#get stdin
pbcopy <&0
#echo to stdout and a file
pbpaste -Prefer txt | tee $tmp
#gist it with https://github.com/defunkt/gist then open in a browser
@isao
isao / gist:5140028
Last active December 14, 2015 19:58
index.js
var path = require('path'),
fs = require('fs'),
is_win = process.platform === 'win32',
homedir = is_win ? process.env.USERPROFILE : process.env.HOME,
confdir = path.join(homedir, '.mojito');
@isao
isao / node 0.10.0
Last active December 14, 2015 20:38
tape "EventEmitter memory leak detected" in node 0.10.0 and runs too many tests

to reproduce:

% git clone [email protected]:isao/byway.git
% cd byway/
% git log --oneline -1
0636462 cleanup

% npm i tape
% node tests/name-routes.js