Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Taujenis alextaujenis

View GitHub Profile
@alextaujenis
alextaujenis / Events.js
Last active Mar 3, 2019
Add custom Events to javascript objects in the browser with a Node.js style syntax
View Events.js
// 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 / whack-a-mole.ino
Last active Dec 20, 2018
Whack-a-mole game written using the Arduino Robots + Big Data libraries http://robotsbigdata.com/
View whack-a-mole.ino
// 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 / main.yml
Last active May 29, 2017
Ansible generate public/private SSH keys
View main.yml
---
- 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 Aug 29, 2015
Ruby Redstorm (Apache Storm) spout with a non-blocking Bunny (RabbitMQ) connection
View redstorm_bunny_spout.rb
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}