Skip to content

Instantly share code, notes, and snippets.

@sixolet
sixolet / execute.js
Created July 26, 2013 18:52
This is a thing that I often use to wrap child_process in Meteor (or variations on it)
Exec = {};
var Fiber = Npm.require('fibers');
var Future = Npm.require('fibers/future');
var Process = Npm.require('child_process');
Exec.spawn = function (command, args, options) {
var out = "";
var err = "";
var ret = new Future;
<head>
<title>questions</title>
</head>
<body>
{{loginButtons}}
<div class="container-fluid">
{{> questions}}
</div>
</body>
@sixolet
sixolet / isolate.js
Created March 18, 2013 18:57
A way of isolating dependencies. Mostly a code sketch, may eventually be part of Meteor
var isolate = function (f) {
var dep = new Deps.Dependency();
var result = Deps.nonreactive(f);
var computation = Deps.autorun(function () {
var newResult = f();
if (!EJSON.equals(result, newResult)) {
dep.changed();
computation.stop();
result = newResult;
}
@sixolet
sixolet / jumpingthegap.md
Last active December 14, 2015 23:29
At the PyCon Education summit, we had a unconference discussion session about helping nontraditional or adult students jump the gap from amateur to pro.

Jumping the Gap: Amateur to Pro

For kids who are into programming, there is a well-worn path to making a good living in industry. Actually, there are a couple:

  • Standard track:

    • You can learn to program using one of the many "kids programming" tools, like Sugar or python itself. I learned on the TI-83. Whatever's available, you're interested already. You're motivated just by the pure ability to put
@sixolet
sixolet / gist:5139496
Created March 12, 2013 01:21
Creates a function to shove a prototype on an object.
var addMethods = function (proto) {
var Constr = function (obj) {
_.extend(this, obj);
};
Constr.prototype = proto;
return function (obj) { return new Constr(obj); };
};