Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am earl on github.
  • I am earl (https://keybase.io/earl) on keybase.
  • I have a public key ASBuUh-JAP6aUw689FsP9KQtFbTtFlYb5ixtU_kFUSoI3go

To claim this, I am signing this object:

@earl
earl / 1-rebol.reb
Last active August 29, 2015 14:07 — forked from hostilefork/1-rebol.reb
Rebol [
Title: "Rebol Dialected Experiment to represent CMake files"
;; See:
;; http://curecode.org/rebol3/ticket.rsp?id=2177
;; http://browsenpm.org/package.json#dependencies
Needs: [
1.0
cmake 2.8
]
REBOL [
title: "Example simple TCP client<->server data transfer"
author: "Richard Smolak"
]
; Length in bytes of test data we transfer.
data-len: 100'000
s: open tcp://:8080
s/awake: func [event /local con] [
@earl
earl / ideal ops.md
Created June 6, 2012 12:24 — forked from bhenerey/ideal ops.md
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

exports.httpConfig = {
staticDir: 'static'
};
exports.urls = [
['/', require('actions')],
];
exports.auth = {
'/admin/': {foo: '62cdb7020ff920e5aa642c3d4066950dd1f01f4d'},
// a simple hack to check if wcscoll(P) really does locale-sensitive collation
#include<wchar.h>
#include<stdio.h>
#include<locale.h>
int main(int argc, char **argv) {
setlocale(LC_ALL, argv[1]);
printf("%d\n", wcscoll(L"z", L"ö"));
return 0;
}
/*
@earl
earl / actions.js
Created June 8, 2010 12:17 — forked from hns/gist:429711
var {Response, skinResponse} = require('ringo/webapp/response');
var {ContinuationSession} = require('ringo/webapp/continuation');
var log = require('ringo/logging').getLogger(module.id);
// the main action is invoked for http://localhost:8080/
exports.index = function(req) {
return skinResponse('./skins/welcome.txt', {title: 'Demo'});
};
/*
** config entry for upload routing:
** [ '/upload', './actions', 'upload', {methods: ['GET', 'POST']} ],
** alternatively:
** [ '/upload', './actions', 'upload_get', {methods: ['GET']} ],
** [ '/upload', './actions', 'upload_post', {methods: ['POST']} ],
*/
var {Response, skinResponse} = require('ringo/webapp/response');
var {ContinuationSession} = require('ringo/webapp/continuation');
>> include('ringo/skin')
>> var schema = JSON.parse(require('ringo/httpclient').get('http://json-schema.org/address').content)
>> var ctx = {}
>> ctx['schema'] = schema
>> ctx['is_properties'] = function (macro) macro.parameters[0] == 'properties'
>> var skin = createSkin('<% for p in <% schema %> render property %><%subskin property %><% if <% is_properties <% index %> %> echo <% index %> %>')
>> render(skin, ctx)
properties
var {defer} = require("ringo/promise");
var {setTimeout} = require("ringo/scheduler");
exports.delayed = function(request) {
var response = defer();
setTimeout(function() {
response.resolve({
status: 200, headers: {}, body: ["Delayed"]
});
}, 1000);