Skip to content

Instantly share code, notes, and snippets.

View michaelsbradleyjr's full-sized avatar
💭
Dip trip, flip fantasia 🎺

Michael Bradley michaelsbradleyjr

💭
Dip trip, flip fantasia 🎺
View GitHub Profile
Joose.Class('Class1', {
use : [ 'Class2' ],
has : {
myAttr : {
is : 'rw',
lazy : function () { return new Class2({ passed : this.getPassThis() }) }
},
passThis : {
is : 'rw',
init : null
var sys = require('sys'),
fs = require('fs'),
exec = require('child_process').exec
require('Task/Joose/NodeJS')
Joose.Module('StringerHasher', function (m) {
body : {
Joose.Class('Samples_MD5', {
my : {
has : {
stringsANDhashes_ASCII : {
is : 'ro',
init : [
var sys = require('sys')
require('joose')
require('hash')
sys.puts(Hash.md5('testesttest'))
var Jolt
use('Jolt', function () {
Jolt = Jolt()
console.log(Jolt.TSD.type)
})
#!/bin/bash
export npm_config_root=$(npm root -g 2>/dev/null)
cd $npm_config_root
find . -name postactivate.sh -exec chmod +x '{}' \;
scripts=$(find . -name __script -type d)
var vm = require('vm')
require('task-joose-nodejs')
var Script = vm.createScript('console.log(typeof Joose.A.each)')
Script.runInThisContext() // -> 'function' is printed to the console
// NEW LOADING STYLE
var Joose = require('joose')() // NOTE the trailing `()`
/* ------- in main Joose ------- */
var Joose = function Joose(jsan) { // NOTE the leading `var`
Joose.top = this
Joose.jsan = jsan
Joose.Namespace.Manager.my = new Joose.Namespace.Manager()
/* ------------ START BOILERPLATE ------------ */
;(function () {
function runner(getExpectedNS /* [NS1], [NS2], [...] */) {
expectedNS = ['Joose', 'MyNS']
if (getExpectedNS) { return expectedNS }
/* ------------ START YOUR COMPONENT SCRIPT ------------ */
// populate expectedNS above with top-level namespaces ref'd in your code
@michaelsbradleyjr
michaelsbradleyjr / postinstall.sh
Created July 20, 2011 06:12
proposed postinstall routine for "collected" jsan
#!/bin/bash
#PODNAME: postinstall.sh
CURRENT_PKG_DIR=$(pwd)
NPM_ROOT=$(npm root 2>/dev/null)
ONE_UP_NPM_ROOT="$NPM_ROOT/../.."