Skip to content

Instantly share code, notes, and snippets.

View jwulf's full-sized avatar
:octocat:
Coding on Halmak

Josh Wulf jwulf

:octocat:
Coding on Halmak
View GitHub Profile
@jwulf
jwulf / app.js
Created October 18, 2012 01:46
just some mongoose node code asking for help
var express = require('express')
, restaurant = require('./routes/restaurant')
, http = require('http')
, config = require('./config')
, stylus = require('stylus');
var app = express();
require('./db');
@jwulf
jwulf / gist:3971482
Created October 29, 2012 04:15
Cross-platform module
(function pgControlWrapper (definition) {
// Got the cross-platform browser code from here:
// http://stackoverflow.com/questions/6665779/best-practices-for-cross-commonjs-browser-development?rq=1
// This file will function properly as a <script> tag, or a module
// using CommonJS and NodeJS or RequireJS module formats. In
// Common/Node/RequireJS, the module exports the PressGang REST API and when
// executed as a simple <script>, it creates a PressGangCCMS global instead.
var compress = function (buf, cb) {
console.log('before ' + buf);
zlib.gzip(buf, function (err, result) {
buf = result;
console.log('in buf ' + buf);
console.log('in string ' + buf.toString());
cb(buf)
});
};
attributes = meteor.Collection('attributes');
objects = meteor.Collection('objects');
// Local Collection only - no such Collection server-side
mergedView = meteor.Collection('merged');
allObjects = objects.find({});
for (myObject=0; myObject<allObjects.count)
{
myMergedView = mergedView.new();
@jwulf
jwulf / rdfalite.rnc
Created February 15, 2013 00:37 — forked from docbook/rdfalite.rnc
# This file IS NOT part of DocBook V5.0
#
# ======================================================================
namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace s = "http://purl.oclc.org/dsdl/schematron"
namespace db = "http://docbook.org/ns/docbook"
default namespace = "http://docbook.org/ns/docbook"
include "../../schemas/docbook/docbook.rnc" {
@jwulf
jwulf / streams-test.js
Last active December 14, 2015 16:19
Minimal Streams reproducer. Piping stream1 -> stream2 -> process.stdout works. Piping stream1 -> stream2 -> stream3 -> process.stdout does not work. Why?
var Stream = require('stream');
var stream1 = new Stream;
stream1.readable = true;
var stream2 = new Stream;
stream2.readable = stream2.writable = true;
var stream3 = new Stream;
stream3.readable = stream3.writeable = true;
@jwulf
jwulf / a.rb
Last active October 6, 2015 10:59
$ jaws module create test test
JAWS: Successfully created test/test
sitapati@MacBook-Air [~/workspace/BGL-JAWS/jaws-bgl/aws_modules] $ rm -rf test
sitapati@MacBook-Air [~/workspace/BGL-JAWS/jaws-bgl/aws_modules] $ jaws module create -l test test
Unsupported cmd test. Must be install|update|create
$ jaws module -l create test test
/Users/sitapati/workspace/JAWS-Framework/JAWS/bin/jaws:155
throw new JawsError('Specify options after cmd', JawsError.errorCodes.
sitapati@MacBook-Air [~/workspace/BGL-JAWS/jaws-bgl/aws_modules] $ jaws
jaws
Commands:
create Create a new JAWS resource.: lambda, endpoint, project, region, stage
dash Experience the thrill of interactively deploying resources from the cutting-edge JAWS command center.
deploy Deploy resources to AWS.: lambda, endpoint, resources
env Manage environment variables.: list, get, set, unset
postinstall Run the post-install automation for an aws-module installed via a package manager. Example: jaws postinstall awsm-users --package-manager npm
run Run an AWSM Lambda locally
sitapati@MacBook-Air [~/workspace/BGL-JAWS/jaws-bgl/aws_modules] $ jaws help create
jaws create
Subcommands:
endpoint Create a new API Gateway endpoint.
lambda Create a new AWSM Lambda. Optionally create an API Gateway endpoint for it at the same time.
project Create a new JAWS Project
region Create a new AWS Region configuration in this JAWS Project.
stage Create a new stage in this JAWS Project.
sitapati@MacBook-Air [~/workspace/BGL-JAWS/jaws-bgl/aws_modules] $ jaws help create endpoint
jaws create endpoint
Options:
--endpoint, -e [string] Create an API Gateway endpoint for this AWSM Lambda
--name [string] Name for the newly created resource
--package-manager, -p [string] Specify a package manager to scaffold for publishing this AWSM Lambda
--runtime, -R [string] Runtime for this AWSM Lambda. Defaults to nodejs