Skip to content

Instantly share code, notes, and snippets.

View N3MIS15's full-sized avatar

David Gray N3MIS15

View GitHub Profile
<!-- Joystick Name: OUYA Game Controller -->
<!-- Button Mappings in Windows: -->
<!-- -->
<!-- ID Button -->
<!-- -->
<!-- 1 O -->
<!-- 2 U -->
<!-- 3 Y -->
<!-- 4 A -->
@N3MIS15
N3MIS15 / gist:e0a46acece0b29ea5abf
Created May 11, 2014 11:16
remove from xbmc library
@app.route('/xhr/library_remove/<media>/<int:id>')
@requires_auth
def xhr_clear_playlist(media, id):
logger.log('CONTROLS :: Removing %s from XBMC library' % media, 'INFO')
xbmc = jsonrpclib.Server(server_api_address())
try:
if media == 'movie':
xbmc.VideoLibrary.RemoveMovie(movieid=id)
elif media == 'tvshow':
padding = 0.3;
module bearing() {
cylinder(r=8+padding, h=12, center=true);
translate([0, 0, 6.5]) cylinder(r1=8+padding, r2=6, h=1, center=true);
}
module main() {
difference() {
union() {
@N3MIS15
N3MIS15 / vacuum_laser_mount.scad
Last active December 12, 2020 19:56
Shopvac/Laser mount for my shapeoko
$fn=120;
spindle = 53;
vacuum = 37.2;
//%color("orange") rotate([0, 0, 90]) import("adapter_1_v1_0.stl");
translate([0, 0, 10]) color("red") {
%cylinder(r=spindle/2, h=90);
%translate([0, 0, -spindle]) cylinder(r=19/2, h=52);
@N3MIS15
N3MIS15 / laser_fan.scad
Created February 6, 2016 05:20
Laser fan mount
module 30fan() {
difference()
{
linear_extrude(height=11, center = true, convexity = 4, twist = 0)
difference()
{
square([30,30],center=true);
difference()
{
circle(r=28.5/2,center=true);
@N3MIS15
N3MIS15 / tilt_repeater.ino
Last active January 10, 2024 13:32
ESP32 Tilt Repeater
// ESP32 Tilt Repeater
// By David Gray
#include "BLEDevice.h"
#include "BLEBeacon.h"
#include "esp_deep_sleep.h"
// User Settings
int SCAN_TIME = 5; // Duration to scan for bluetooth devices (in seconds).
int TIME_TO_SLEEP = 60; // Duration ESP32 will go to sleep between scans (in seconds).
@N3MIS15
N3MIS15 / beacon.py
Last active March 20, 2024 06:04
micropython iBeacon example
import struct
import ubluetooth as bt
from micropython import const
MANUFACTURER_ID = const(0x004C)
DEVICE_TYPE = const(0x02)
DATA_LENGTH = const(0x15)
BR_EDR_NOT_SUPPORTED = const(0x04)
FLAG_BROADCAST = const(0x01)
MANUFACTURER_DATA = const(0xFF)