Skip to content

Instantly share code, notes, and snippets.

View enykeev's full-sized avatar
💥
Boom!

Kirill Enykeev enykeev

💥
Boom!
View GitHub Profile

Premise

Not so distant future. A colony of autonomous space drones arrives at an asteroid belt. The colony ship contains construction facilities, a basic refinery and a few mining drones. Everything is of most basic, rugged design: hydrogen based propulsion, solar for energy, steel frames, silicone and copper based electronics, standardized, easy to manufacture in space components. All controlled by an AI.

The purpose of this colony is to mine resources out of the belt to eventually build a megastructure in the system: a dyson sphere, a hyperspace gate, a mass relay, whatever. The construction requires truly massive amounts of resources and so you need to build an equivalently big infrastructure to collect them. Worst of all, you're not alone in the belt. Other colonies are arriving and have similar initiatives. Each AI is independent and has its own opinion on where the path of least resistance lies. AIs may decide to work together on the same project, keep neutrality and self-regulate, aggressivel

@enykeev
enykeev / 1.sql
Last active April 20, 2022 07:39
PG partitioning
-- Kafka-like partitioning
select abs(hashtext(id)) % 10 as partition, count(*) from events group by partition

Keybase proof

I hereby claim:

  • I am enykeev on github.
  • I am enykeev (https://keybase.io/enykeev) on keybase.
  • I have a public key ASAQfurtpn5_RfID7W5VFKnYV0tAhI9yy-ifDBu-fCklHQo

To claim this, I am signing this object:

@enykeev
enykeev / analyse.js
Created October 15, 2015 03:38
Browserify analyser
'use strict';
var fs = require('fs');
var vm = require('vm');
var filename = process.argv[process.argv.length - 1];
var fingerprint = '(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module \'"+o+"\'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})';
var module_names = {
1: filename
@enykeev
enykeev / a.js
Last active October 6, 2015 16:01
'use strict';
var a;
(function () {
var b = 'c';
a = function d() {
var e = 'f';
};
})()
@enykeev
enykeev / invoice.yaml
Created September 22, 2015 15:51
YAML examples
--- !clarkevans.com/^invoice
invoice: 34843
date : 2001-01-23
bill-to: &id001
given : Chris
family : Dumars
address:
lines: |
458 Walkman Dr.
Suite #292
@enykeev
enykeev / gulpfile.js
Created June 18, 2015 04:46
Control Gulp with stdio
gulp.task('watch', function() {
gulp.watch('static/*', ['static']);
gulp.watch('css/**/*.css', ['css']);
gulp.watch(['js/**/*.js'], ['lint', 'browserify']);
process.stdin.setEncoding('utf8');
process.stdin.on('readable', function() {
var chunk = process.stdin.read();
switch (chunk) {
case null:
@enykeev
enykeev / gist:e0af262e4a34dcf463f1
Last active August 29, 2015 14:20
st2auth config
<VirtualHost *:49100>
ServerName 172.168.50.50:49100
WSGIScriptAlias / /usr/lib/python2.7/dist-packages/st2auth/wsgi.py
WSGIDaemonProcess st2auth user=stanley group=st2robots processes=2 threads=25
WSGIProcessGroup st2auth
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/mycert.crt
@enykeev
enykeev / style.less
Created October 19, 2014 07:09
Sonar Animated
.sonar {
display: block;
width: 200px;
height: 200px;
box-sizing: border-box;
position: absolute;
top: 200px;
left: 200px;
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
${PYTHON:-python} -m subunit.run discover -t ./ ./mistral/tests/unit $LISTOPT $IDOPTION; \
OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \