Skip to content

Instantly share code, notes, and snippets.

@femto113
femto113 / generate.c
Last active March 3, 2019 01:29 — forked from munificent/generate.c
A random dungeon generator that (no longer) fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
// 2008-2019
const int H = 40;
const int W = 80;
int m[H][W];
int g(int x)
var cluster = require('cluster');
var numCPUs = parseInt(process.argv[2]) || 1;
var MESSAGE_BURST = 10; // how many messages are sent by master in each round
var WORK_COST = 128; // factor to slow down average message handling cost in each worker
var REPORTABLE_WORK = 100; // how often worker reports its accomplishments
var ready_workers = [];
if (cluster.isMaster) {
@femto113
femto113 / bootstrap_chef.bash
Created November 30, 2012 00:18 — forked from chrismdp/bootstrap_chef.bash
Bootstrap Chef Solo on Ubuntu
#!/usr/bin/env bash
# call like this on the target server:
# NODENAME='foo' CHEF_ENV='production' RUNLIST='["role[foo]","recipe[bar]"]' CHEFREPO='git@example.com:repo.git' bash <( curl -L https://raw.github.com/gist/1026628 )
# You will need to ensure that the ssh key is already set up on the server.
set -e
export CHEF_DIR="${HOME}/chef"
sudo rm -rf $CHEF_DIR
mkdir -p "$CHEF_DIR"
@femto113
femto113 / LICENSE.txt
Created February 20, 2012 08:50 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
Copyright waived, this code is in the public domain.