Skip to content

Instantly share code, notes, and snippets.

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

eta eeeeeta

🏳️‍⚧️
wiggly donkers
View GitHub Profile
extern crate indicatif;
use indicatif::{ProgressBar, MultiProgress};
use std::thread;
use std::time::Duration;
fn main() {
let mp = MultiProgress::new();
let pb1 = mp.add(ProgressBar::new(100));
let pb2 = mp.add(ProgressBar::new(100));
thread::spawn(move || {
@eeeeeta
eeeeeta / sqa-devlog-gen.rs
Last active January 2, 2017 13:11
Generates the "This week's commit log" section of SQA devlog updates
/* Generates the "This week's commit log" section */
use std::env;
use std::process::Command;
struct Project {
name: &'static str,
path: &'static str
}
# Anki extension to disallow pressing Enter/Space on incorrect typed answer.
# author: eta (theta.eu.org)
from aqt.reviewer import Reviewer
from aqt.utils import downArrow, tooltip
from anki.utils import stripHTML
from aqt.qt import *
import HTMLParser
def _keyHandlerPatched(self, evt):
key = unicode(evt.text())
;;; 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
;; -*- 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
@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};
@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 / 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>

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 / 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) {