Skip to content

Instantly share code, notes, and snippets.

#define CONFIG_ITEM(set_id, item_type, item_id, default, desc) \
/datum/config_set/set_id { \
var/item_id; \
} \
/datum/config_builder/pop_items(list/l) { \
. = ..(); \
.[#set_id] += list(list(item_type, #item_id, default, desc)); \
}
#define CONFIG_FILE(file_id, file_name) \
/decl/config_entry/file_id {} \
/decl/config_file/file_id { \
id = #file_id; \
file_path = file_name; \
entry_type = /decl/config_entry/file_id; \
holder_type = /datum/config_file/file_id; \
} \
/datum/config_file/file_id {} \
/datum/config_holder { \
@mloc
mloc / config.dm
Last active October 5, 2017 13:34
CONFIG_FILE(game, "game.json")
CONFIG_ENTRY(game, doot_count, num)
desc = "Number of doots"
default = 10
CONFIG_ENTRY(game, cat_name, string)
desc = "Name of the cat"
default = "Runtime"
@mloc
mloc / log
Created September 29, 2017 09:30
PLAY [all] ************************************************************************************************************************************************************
TASK [Gathering Facts] ************************************************************************************************************************************************
ok: [local]
TASK [elasticsearch] **************************************************************************************************************************************************
ok: [local]
TASK [logstash] *******************************************************************************************************************************************************
@mloc
mloc / elk.yml
Created September 29, 2017 09:29
---
-
become: true
hosts: all
tasks:
-
name: "elasticsearch"
docker_container:
name: elasticsearch
docker_host: "{{docker_host|default()}}"
@mloc
mloc / elk.yml
Created September 28, 2017 11:31
---
-
become: true
hosts: all
tasks:
-
name: "elasticsearch"
docker_container:
name: elasticsearch
docker_host: "{{docker_host}}"
extern crate rustc_serialize;
extern crate zmq;
extern crate nix;
extern crate c_ares;
use std::sync::{Arc, Mutex};
mod config;
mod cares_loop;

Keybase proof

I hereby claim:

  • I am mloc on github.
  • I am mloc (https://keybase.io/mloc) on keybase.
  • I have a public key whose fingerprint is 190D 8911 10E5 1FCF C41F 8A78 6D15 E561 B2CC 713C

To claim this, I am signing this object:

/datum/softrng
var/x
var/y
/datum/softrng/New(seed = world.timeofday)
x = round(seed) % 65536
y = x
// xorshift16, Marsaglia2003: https://www.jstatsoft.org/article/view/v008i14
/datum/softrng/proc/rand16()
for i in range(2**16):
print('/var/a{} = "{}"'.format(i, i))