Skip to content

Instantly share code, notes, and snippets.

View alextaujenis's full-sized avatar

Alex Taujenis alextaujenis

View GitHub Profile
@alextaujenis
alextaujenis / whack-a-mole.ino
Last active December 20, 2018 22:52
Whack-a-mole game written using the Arduino Robots + Big Data libraries http://robotsbigdata.com/
// Arduino Whack-a-mole game.
// Copyright 2018 Alex Taujenis
// MIT License
#include <RBD_Timer.h> // https://github.com/alextaujenis/RBD_Timer
#include <RBD_Light.h> // https://github.com/alextaujenis/RBD_Light
#include <RBD_Capacitance.h> // https://github.com/alextaujenis/RBD_Capacitance
#include <RBD_Threshold.h> // https://github.com/alextaujenis/RBD_Threshold
#include <RBD_HumanSensor.h> // https://github.com/alextaujenis/RBD_HumanSensor
@alextaujenis
alextaujenis / Events.js
Last active March 3, 2019 06:39
Add custom Events to javascript objects in the browser with a Node.js style syntax
// Add custom Events to javascript objects in the browser with a Node.js style syntax
// https://gist.github.com/alextaujenis/0dc81cf4d56513657f685a22bf74893d
// Copyright 2018 Alex Taujenis
// MIT License
class Events {
constructor () {
this._callbacks = {}
}
@alextaujenis
alextaujenis / main.yml
Last active May 29, 2017 17:01
Ansible generate public/private SSH keys
---
- name: Generate public/private SSH keys for an existing user (will not overwrite existing keys)
user:
name: root
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: /root/.ssh/id_rsa
state: present
@alextaujenis
alextaujenis / redstorm_bunny_spout.rb
Last active August 29, 2015 14:08
Ruby Redstorm (Apache Storm) spout with a non-blocking Bunny (RabbitMQ) connection
require "red_storm"
require "bunny"
require "thread"
# Storm spout with a non-blocking RabbitMQ connection
class YourSpout < RedStorm::DSL::Spout
output_fields :your_field_name
QUEUE_NAME = "your.queue.name"
on_init {@q, @bunny = Queue.new, detach_bunny}