Skip to content

Instantly share code, notes, and snippets.

Avatar

Ron Dagdag rondagdag

View GitHub Profile
@rondagdag
rondagdag / PhotonWS.cs
Created February 5, 2016 21:25
Here's what I used to receive UDP Packets from Photon
View PhotonWS.cs
using UnityEngine;
using System.Collections;
using System;
using System.Security.Policy;
using System.Threading;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Net.Sockets;
@rondagdag
rondagdag / LittlebitsWebSocket.cs
Created November 30, 2015 20:20
Here's my code to connect Unity3d to Littlebits Cloudbit via websockets
View LittlebitsWebSocket.cs
using UnityEngine;
using System.Collections;
using System;
using System.Security.Policy;
using System.Threading;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using WebSocketSharp;
using WebSocketSharp.Net;
@rondagdag
rondagdag / gist:2e2530f4f2394da79183238218a99557
Created December 9, 2019 20:11
Global AI Bootcamp Dallas - Code of Conduct
View gist:2e2530f4f2394da79183238218a99557
A set of rules outlining the norms, rules, and responsibilities of, and or proper practices for, an individual.
Code of Conduct
This code of conduct applies for all events organized by Hackster Dallas.
Hackster Dallas is dedicated to providing a harassment-free conference experience for everyone, regardless of gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, age or religion. We do not tolerate harassment of conference participants in any form. Sexual language and imagery is not appropriate for any conference venue, including talks. Conference participants violating these rules may be sanctioned or expelled from the conference without a refund at the discretion of the conference organizers.
Harassment includes, but is not limited to:
Verbal comments that reinforce social structures of domination related to gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, age, religion.
@rondagdag
rondagdag / Arduino101_Pixy.ino
Created January 10, 2017 20:21
Arduino 101 + Pixy
View Arduino101_Pixy.ino
//
// begin license header
//
// This code is created by Ron Dagdag
//
// All source code is provided under the terms of the
// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
// Those wishing to use Pixy source code, software and/or
// technologies under different licensing terms should contact us at
// ron@dagdag.net. Such licensing terms are available for
@rondagdag
rondagdag / facedroid.nodered
Created January 20, 2018 22:09
Face Droid
View facedroid.nodered
[{"id":"3b103181.712cee","type":"tab","label":"Flow 1"},{"id":"31f51798.fbcf78","type":"inject","z":"3b103181.712cee","name":"1s tick","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"x":161,"y":653,"wires":[["afb09ed3.3b053"]]},{"id":"c9638685.c54e28","type":"arduino out","z":"3b103181.712cee","name":"","pin":"9","state":"OUTPUT","arduino":"bbed5737.2789a8","x":664.5,"y":701,"wires":[]},{"id":"ff197310.fad94","type":"function","z":"3b103181.712cee","name":"Toggle output on input","func":"\n// If it does exist make it the inverse of what it was or else initialise it to false\n// (context variables persist between calls to the function)\ncontext.level = !context.level || false;\n\n// set the payload to the level and return\nmsg.payload = context.level;\nreturn msg;","outputs":1,"noerr":0,"x":369,"y":653,"wires":[["c9638685.c54e28"]]},{"id":"55a8abbd.d25d14","type":"debug","z":"3b103181.712cee","name":"","active":true,"console":"false","complete":"payload","x":667.5,"y":219,"
@rondagdag
rondagdag / coffeeAmazonDRS.ino
Created February 24, 2017 20:42
coffeeAmazonDRS.ino
View coffeeAmazonDRS.ino
/*******************************************************************
Check out the included Arduino sketches and the getting started
guide here!
https://github.com/andium/AmazonDRS
This is an Arduino implementation of an Amazon Dash Replenishment
device. It currently supports the critical API endpoints necessary
for registering a device and submitting replenishment requests. This
library is tightly coupled to the WiFi101 library, which means it will
work great with the Arduino MKR1000, Adafruit Feather MO w/ the ATWINC1500,
@rondagdag
rondagdag / iotsnowglobe_esp8266.ino
Created July 5, 2017 23:13
IoTSnowGlobe for esp8266
View iotsnowglobe_esp8266.ino
/*
IoT Snow Globe
Ron Dagdag @rondagdag
WiFi Web Server
A simple web server that shows the value of the analog input pins.
using a WiFi shield.
This example is written for a network using WPA encryption. For
View coffeeAmazonDRS2.ino
/*******************************************************************
Arduino Sketch to reorder items via Amazon Dash Service
Written by @RonDagDag and Johnathan Hottell
Read more at https://www.hackster.io/coffee-drinkers/amazon-drs-promise-never-miss-coffee-break-again-a88584
Licensed under the Apache License, Version 2.0 (the "License");
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@rondagdag
rondagdag / KeyboardPrank.ino
Last active August 1, 2016 02:51
Presses backspace then smiley face every 15 seconds
View KeyboardPrank.ino
//Presses backspace then space every 15 seconds
#include <Keyboard.h>;
int timeSeconds = 15 ; //Change to change interval
const int pin = 0; // input pin for pushbutton
int counter = 0; // button push counter
void setup() {
// make the pushButton pin an input
pinMode(pin, INPUT_PULLUP);
View colorsense-test.js
var socket = require('socket.io-client')('ws://192.168.43.141:3000/');
socket.on('connect', function(){ console.log('connect') });
socket.on('event', function(data){ console.log('event') });
socket.on('disconnect', function(){ console.log('disconnect') });
socket.on('colors', function(colors){
console.log(colors);
/*var sum = colors.clear;
var r, g, b;
r = colors.red; r /= sum;
g = colors.green; g /= sum;