Timers (setTimeout
and friends!) for RuntimeJS.
var timers = require('runtime-timers')
timers.install()
setInterval(function() {
// THIS ISN'T EVEN MY FINAL FORM | |
console.log((function (ctxt) { | |
cats: { | |
with(ctxt) { | |
try { | |
return cats | |
} finally { | |
break cats | |
} | |
} |
http://www.perkin.org.uk/posts/automated-virtualbox-smartos-installs.html
save the following as setup.sh and run it:
#!/bin/sh
#
# Configurables:
I hereby claim:
To claim this, I am signing this object:
FROM ubuntu:14.04 | |
RUN apt-get update && apt-get -y install wget build-essential | |
RUN apt-get install -y tree | |
WORKDIR /gba | |
RUN wget http://iweb.dl.sourceforge.net/project/devkitpro/devkitARM/previous/devkitARM_r42-x86_64-linux.tar.bz2 | |
RUN wget http://iweb.dl.sourceforge.net/project/devkitpro/libgba/libgba-20150106.tar.bz2 | |
RUN wget http://iweb.dl.sourceforge.net/project/devkitpro/maxmod/maxmod-gba-1.0.9.tar.bz2 | |
RUN wget http://hivelocity.dl.sourceforge.net/project/devkitpro/libfat/libfat-gba-1.0.13.tar.bz2 |
// my problem: (with a bit of handwaving here — imagine that each step is | |
// _actually_ async) | |
function doAThing() { | |
return new Promise(resolve => { // A | |
setTimeout(resolve, 100, Math.random()) | |
}).then(randomNum => { // B (derived from A's result) | |
return randomNum * Math.random() | |
}).then(superRandomNumber => { // C | |
return superRandomNumber * originalRandomNumber | |
// where "originalRandomNumber" === "randomNum" from A |
// my npm dep tree (fake, made of lies) | |
myproject | |
├─┬ mydep@A.B.C | |
│ └── bluebird@X.Y.Z | |
└── bluebird@M.N.O |
import itertools | |
def complex_itermerge(compare, *iters): | |
_i = [iter(i) for i in iters] | |
backlog = [] | |
for _i_vals in itertools.izip(*_i): | |
assoc = zip(_i, _i_vals) | |
state_length = len(assoc) | |
for i in range(0, state_length): | |
lhs = assoc[i] |
from waiter import Waiter | |
waiter = Waiter() | |
waiter/"https://twitter.com/users/show.json"/{ | |
'screen_name':'isntitvacant', | |
} | |
#include <v8.h> | |
using namespace v8; | |
// so yeah my algorithms are a little rusty it turns out. | |
// this is largely from memory. | |
// )`: don't hate | |
int64_t fibonacci(int64_t input) { | |
int64_t two_before = 0; | |
int64_t one_before = 1; |