git clone https://github.com/thp/psmoveapi.git --recursive
sudo apt-get update -y
cd psmoveapi/
mkdir build
cd build
cmake .. -DPSMOVE_BUILD_CSHARP_BINDINGS:BOOL=OFF -DPSMOVE_BUILD_EXAMPLES:BOOL=ON -DPSMOVE_BUILD_JAVA_BINDINGS:BOOL=OFF -DPSMOVE_BUILD_OPENGL_EXAMPLES:BOOL=OFF -DPSMOVE_BUILD_PROCESSING_BINDINGS:BOOL=OFF -DPSMOVE_BUILD_TESTS:BOOL=OFF -DPSMOVE_BUILD_TRACKER:BOOL=OFF -DPSMOVE_USE_PSEYE:BOOL=OFF
make
sudo cp {psmove.py,_psmove.so} /usr/lib/python3.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float t = 0; | |
Circle myCircle; | |
boolean pressedKeys[] = new boolean [4]; | |
void setup() { | |
size(600, 600); | |
pixelDensity(2); | |
colorMode(HSB, 360, 100, 100); | |
myCircle = new Circle(width / 2, height / 2, 100, 148); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const oReq = new XMLHttpRequest(); | |
oReq.open("POST", 'http://localhost:3000/upload', true); | |
oReq.onload = function (oEvent) { | |
console.log('uploaded!'); | |
// File was Uploaded ok. | |
}; | |
// var html = d3.select("svg").node().parentNode.innerHTML; | |
const svgDoctype = '<?xml version="1.0" standalone="no"?>' | |
+ '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sleep 15 | |
MYIP="$(/bin/hostname --all-ip-addresses)" | |
curl https://api.pushbullet.com/v2/pushes \ | |
-u <your api token>: \ | |
-d device_iden="<device ID from pushbullet>" \ | |
-d type="note" \ | |
-d title="Pi IP Address" \ | |
-d body=$MYIP \ | |
-X POST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from imposm.parser import OSMParser | |
from shapely import geometry, ops | |
import axi | |
import math | |
import sys | |
# put your lat/lng here | |
LAT, LNG = 0, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>devicemotion event</title> | |
<script src="script.js"></script> | |
</head> | |
<body> | |
<h1>devicemotion event demo</h1> | |
<p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Neosegment.h" | |
#define SERIAL_BAUD 115200 | |
#define nDigits 6 | |
#define PIN 9 | |
Neosegment neosegment(nDigits, PIN, 100); | |
uint16_t i, j; | |
void setup() { | |
Serial.begin(SERIAL_BAUD); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import argparse | |
import base64 | |
import os | |
# This file parses the HTML created by Adobe Fusion 360 Turntable rendering feature and saves the frames as individual PNGs | |
def parse_html_dump_images(html_file): | |
for i, line in enumerate(html_file): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
// Adapted from the Adafruit NeoPixel test example. | |
// Parameter 1 = number of pixels in strip | |
// Parameter 2 = pin number (most are valid) | |
// Parameter 3 = pixel type flags, add together as needed: | |
// NEO_RGB Pixels are wired for RGB bitstream | |
// NEO_GRB Pixels are wired for GRB bitstream | |
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
When the sketch is uploaded, the ESP8266 will reboot and create its own access point called AutoConnect AP. Connecting to that AP will bring up the | |
list of available access points. Enter Username and PW for the access point and ESP module will save the credentials for you. | |
When the module is restarted, it will connect to the AP that you chose and should be available on the network. You can get its IP from the Serial monitor | |
or use mDNS library (it's uncommented by default, along with all usage of the library) to make the module discoverable. | |
To change colors on the module (Neopixels on Pin 2), simply go to the root URL of the web server. |