Skip to content

Instantly share code, notes, and snippets.

@brunokruse
brunokruse / photo-exif.txt
Created October 2, 2017 03:05
test exif
{
'YResolution': (72, 1),
'ResolutionUnit': 2,
'Make': u 'Apple',
'Flash': 16,
'SceneCaptureType': 0,
'GPSInfo': {
1: u 'N',
2: ((40, 1), (41, 1), (4204, 100)),
3: u 'W',
@brunokruse
brunokruse / template.html
Created September 22, 2017 17:39
simple html / javascript
<html>
<head>
<style>
body {
background: #FF00AA
}
@brunokruse
brunokruse / template.html
Created September 22, 2017 17:39
simple html / javascript
<html>
<head>
<style>
body {
background: #FF00AA
}
@brunokruse
brunokruse / fw-ppg-heartbeat
Created July 30, 2017 23:19
floating workshjops esp32 ppg + neopixel (the blinking is kinda shitty but it works)
/*
Optical Heart Rate Detection (PBA Algorithm) using the MAX30105 Breakout
By: Nathan Seidle @ SparkFun Electronics
Date: October 2nd, 2016
https://github.com/sparkfun/MAX30105_Breakout
This is a demo to show the reading of heart rate or beats per minute (BPM) using
a Penpheral Beat Amplitude (PBA) algorithm.
It is best to attach the sensor to your finger using a rubber band or other tightening
#!/usr/bin/env python
#
# ESP8266 & ESP32 ROM Bootloader Utility
# Copyright (C) 2014-2016 Fredrik Ahlberg, Angus Gratton, Espressif Systems (Shanghai) PTE LTD, other contributors as noted.
# https://github.com/espressif/esptool
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later version.
#
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN) #Read output from PIR motion sensor
GPIO.setup(3, GPIO.OUT) #LED output pin
while True:
i=GPIO.input(11)
if i==0: #When output from motion sensor is LOW
print "No intruders",i
@brunokruse
brunokruse / angleLerp.js
Created March 20, 2016 02:46 — forked from shaunlebron/angleLerp.js
The best way to interpolate 2D angles
/*
2D Angle Interpolation (shortest distance)
Parameters:
a0 = start angle
a1 = end angle
t = interpolation factor (0.0=start, 1.0=end)
Benefits:
1. Angles do NOT need to be normalized.
@brunokruse
brunokruse / return paragraphs list for image
Created January 27, 2014 16:18
get_paragraphs_for_image_id()
// calls for getting a list of paragraphs for an image id from url
// api/images/get_paragraphs_for_image_id/?id=374
public function get_paragraphs_for_image_id() {
global $json_api;
$id = $json_api->query->id;
$paragraphs_list = $this->find_matching_paragraphs($id);
return $paragraphs_list;
}
@brunokruse
brunokruse / gist:7951153
Created December 13, 2013 20:53
get_all_chapters
{
"Chapters": {
"Fashion": {
"Paragraphs": [
{
"description": "string",
"id": 426,
"images": [],
"title": "Twiggy"
}