Skip to content

Instantly share code, notes, and snippets.

View oveddan's full-sized avatar

Dan Oved oveddan

View GitHub Profile
@oveddan
oveddan / index.html
Created May 9, 2018 14:50
PoseNet in P5 - Multiple Poses Estimation
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.dom.min.js"></script>
<!-- Load TensorFlow.js -->
<script src="https://unpkg.com/@tensorflow/tfjs"></script>
<!-- Load Posenet -->
<script src="https://unpkg.com/@tensorflow-models/posenet"></script>
<script src="sketch.js"></script>
</head>
@oveddan
oveddan / index.html
Last active May 25, 2018 18:58
PoseNet in P5 - Single Pose Estimation
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.dom.min.js"></script>
<!-- Load TensorFlow.js -->
<script src="https://unpkg.com/@tensorflow/tfjs"></script>
<!-- Load Posenet -->
<script src="https://unpkg.com/@tensorflow-models/posenet"></script>
<script src="sketch.js"></script>
</head>
@oveddan
oveddan / lunar_lander_controller.ino
Created January 31, 2018 08:41
Lunar Lander Game Controller Code
#include <Keyboard.h>
#include <Mouse.h>
const int Y_PIN = A0;
const int LEFT_PIN = 2;
const int RIGHT_PIN = 3;
const int START_PIN = 6;
void setup() {
// put your setup code here, to run once:
@oveddan
oveddan / index.js
Last active February 14, 2022 15:10
Japanese Weather Diorama Arduino and Node.js code - oveddan.github.io/blog/posts/physical_computing/weather-diorama/
const SerialPort = require('serialport');
const request = require('request');
const myKey = '12312314';
const moment = require('moment')
const Readline = SerialPort.parsers.Readline;
const thirtyMinutesInSeconds = 60 * 60
const SUNRISE = 0
@oveddan
oveddan / cellular_zoetrope.pde
Last active October 26, 2017 18:31
Cellular Voronoi Zoetrope Generator
PShader frag;
int frames = 33;
float frameTheta = 2. * PI / frames;
int h = 520;
int w = 520;
float base = 2 * tan(frameTheta / 2.)* h;
int renderSize = ceil(base);
@oveddan
oveddan / light_loop.ino
Created October 12, 2017 17:31
Light feedback loop Arduino code
/*
Adafruit Arduino - Lesson 4. 8 LEDs and a Shift Register
*/
int latchPin = 5;
int clockPin = 6;
int dataPin = 4;
byte leds[2];
@oveddan
oveddan / zoetrope_flasher_test.ino
Last active October 12, 2017 17:24
Controls the flashing speed of an analog RGB led strip. The on duration is 10%. For use with a zoetrope
#define LOWER_READ 143
#define UPPER_READ 940
#define INTERVAL_PIN A0
#define REDPIN 5
#define GREENPIN 6
#define BLUEPIN 9
#define ON_PERCENTAGE .1
0x3a6aF697e89b8c1caFf43d685ebc2b20b8B65F86
@oveddan
oveddan / logReader.js
Created July 25, 2012 22:21
TDD callback testing sample
var fs = require('fs');
var logReader = {
getLogEntries : function(logDate, callback){
if(!(logDate instanceof Date))
throw new Error('date must be of type Date');
var logFileName = logDate.toDateString() + '.log';
fs.readFile(logFileName, function(err, data){