Skip to content

Instantly share code, notes, and snippets.

View eeeeeta's full-sized avatar
🏳️‍⚧️
wiggly donkers

eta eeeeeta

🏳️‍⚧️
wiggly donkers
View GitHub Profile
@eeeeeta
eeeeeta / main.cpp
Created November 8, 2014 12:06
Enjoyable Minetest loading messages
progress = 20 + client->mediaReceiveProgress() * 50 + 0.5;
std::stringstream message;
message.precision(3);
// Enjoyable loading messages!
if (progress < 30) {
message << gettext("Coding next version...");
}
else if (progress < 50) {
message << gettext("Leaking memory...");
}
### Keybase proof
I hereby claim:
* I am eeeeeta on github.
* I am eeeeeta (https://keybase.io/eeeeeta) on keybase.
* I have a public key whose fingerprint is 3F74 F851 106E 7FAA 384D C5A0 ACDB 5E2B 0342 3DC7
To claim this, I am signing this object:
@eeeeeta
eeeeeta / markov.js
Created December 31, 2014 20:21
markov chain module for irc bots
/* jslint node: true, esnext: true */
"use strict";
var Markov;
var Chance = require('chance');
function chunk(arr, chunkSize) {
var R = [];
for (var i=0; i<arr.length; i+=chunkSize)
R.push(arr.slice(i,i+chunkSize));
@eeeeeta
eeeeeta / buttond.js
Created April 5, 2015 07:52
Daemon to keep track of reddit's /r/thebutton April Fools 2015 prank. You'll need io.js (or run node.js with --harmony), a Redis server running locally, and the packages needle, redis and ws. You'll probably want to run this with systemd or something else to restart it, as it doesn't have bulletproof error handling.
/*jslint node:true,esnext:true*/
"use strict";
var needle = require('needle'),
redis = require('redis'),
ws = require('ws'),
net = require('net');
console.log('~ buttond v2 by η (eeeeeta) ~');
console.log('INIT: Requesting http://reddit.com/r/thebutton');
needle.get('http://reddit.com/r/thebutton', {follow: 5}, function(err, res) {

buttond

this is a small daemon I rigged up to collect data from reddit's /r/thebutton social experiment. to run it, you will need:

  • redis running on localhost
  • to npm install needle redis moment ws

it should collect data like this:

  • it will make a redis hash called clicks with participant number (with comma) as key and seconds left as value
  • it will make a redis key called record with the lowest recorded amount of seconds left as value
  • it will publish every click on thebutton.clicks and every tick on thebutton.ticks
@eeeeeta
eeeeeta / barm.c
Created August 28, 2015 09:39
crappy grayscale lemonbar manager
/*
* lemonbar manager
* by eeeeeta
*/
#define UPDATE_INTERVAL 10
#define GRAY "%{F#808080}"
#define WHITE "%{F#FFFFFF}"
#include <stdio.h>
#include <time.h>
@eeeeeta
eeeeeta / nein.c
Created September 5, 2015 19:03
nein - eta's little esolang
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
struct nstate {
uint8_t rega; /* register a */
uint8_t regb; /* register b */
uint8_t *cur; /* data ptr */
unsigned int iloc; /* location of last 'i' */
bool jbk; /* jump back */
@eeeeeta
eeeeeta / gpx-parser.rs
Last active November 26, 2015 07:20
first bit of rust code - parses GPX trackpoints. probably quite buggy :P
extern crate xml;
extern crate chrono;
use std::fs::File;
use std::io::BufReader;
use std::vec::Vec;
use chrono::*;
use xml::reader::{EventReader, XmlEvent};
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;;; eta-notes.el --- eta's note-taking elisp hunks
;; Copyright (C) 2016 eta
;; Author: eta
;; Keywords: org-mode org note note-taking notes
;; Version: 0.0.1
;;; Commentary:
;; Various bits of elisp that do note-taking things