Skip to content

Instantly share code, notes, and snippets.

View unixunion's full-sized avatar

Kegan Holtzhausen unixunion

View GitHub Profile
@unixunion
unixunion / SerialCallbackTest.cs
Created January 20, 2015 16:04
Arduino's don't seem to trigger the callback onDataReceived.
using System;
using System.IO.Ports;
using System.Threading;
using System.ComponentModel;
class Program
{
public static void Main()
{
SerialPort mySerialPort = new SerialPort("/dev/tty.usbmodem621", 9600, Parity.None, 8, StopBits.One);
@unixunion
unixunion / JeremyCricket.ino
Last active August 29, 2015 14:17
Jeremy Cricket Day / Night edition
/*
_____ _ _ _ ____ _____
/ ____| (_) | | | | / __ \ / ____|
| | _ __ _ ___| | _____| |_| | | | (___
| | | '__| |/ __| |/ / _ \ __| | | |\___ \
| |____| | | | (__| < __/ |_| |__| |____) |
\_____|_| |_|\___|_|\_\___|\__|\____/|_____/ 2.0
CricketOS chirps at configured day/night/day transitions for a certain amount of songs, then waits until
the next transistion. Prank your firends, they will have a hard time locating it.
@unixunion
unixunion / TcpIpJoinerOverAWS.java
Created April 10, 2015 11:25
ec2 joiner patch for hazelcast
package com.hazelcast.cluster;
import static com.amazonaws.regions.RegionUtils.getRegion;
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@unixunion
unixunion / dust.ino
Last active December 22, 2021 19:01
Sharp Dust Sensor
/*
Standalone Sketch to use with a Arduino Fio and a
Sharp Optical Dust Sensor GP2Y1010AU0F
Blog: http://arduinodev.woofex.net/2012/12/01/standalone-sharp-dust-sensor/
Code: https://github.com/Trefex/arduino-airquality/
For Pin connections, please check the Blog or the github project page
Authors: Cyrille Médard de Chardon (serialC), Christophe Trefois (Trefex)
Changelog:
@unixunion
unixunion / app.js
Created June 19, 2015 21:39
angular-vertxbus duplicate messages
/* global angular:false,console:false */
(function () {
'use strict';
angular.module('app', ['ng', 'knalli.angular-vertxbus'])
.config(function(vertxEventBusProvider) {
vertxEventBusProvider
.useDebug(true)
.useUrlServer('http://localhost:8080');
})
package com.deblox.clustering;
import com.deblox.Boot;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.eventbus.EventBus;
import io.vertx.core.eventbus.Message;
import io.vertx.core.eventbus.MessageConsumer;
package com.deblox.clustering;
import io.vertx.core.Handler;
import io.vertx.core.eventbus.Message;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
/**
package com.deblox.greatsnipe.git.impl;
import com.deblox.greatsnipe.git.GitServerProvider;
import io.netty.handler.codec.http.HttpHeaders;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.json.JsonObject;
import io.vertx.core.logging.Logger;
package com.deblox.greatsnipe.git;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import java.io.IOException;
import java.net.MalformedURLException;
/**
* provider to be extended / implemented in specific supported API's
package com.deblox.greatsnipe.git.impl;
import com.deblox.greatsnipe.git.GitServerProvider;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import org.gitlab.api.GitlabAPI;
import org.gitlab.api.models.GitlabProject;