Skip to content

Instantly share code, notes, and snippets.

@davedarko
davedarko / countdown-generator.sh
Created Feb 17, 2020
Countdown Video Generator for Mate Light
View countdown-generator.sh
#!/bin/sh
#This example will create a 15min video, with 10 frames per second
fps=10;
seconds=900;
mantissaDigits=2;
upperFont=14;
#upperFont=53;
lowerFont=100;
ffmpeg -loop 1 -i ~/Pictures/black-background.png -c:v libx264 -r $fps -t $seconds -pix_fmt rgb24 -vf "fps=$fps,drawtext=fontfile='/usr/share/fonts/truetype/freefont/FreeMono.ttf':fontcolor=white:fontsize=$upperFont:x=(w-text_w)/2:y=(h-text_h)/2:text='%{eif\:(($seconds-t)/60)\:d}\:%{eif\:(mod($seconds-t, 60))\:\d\:2 }'" "$seconds seconds countdown timer.mp4";
View mqtt_shortener.js
var mqtt = require('mqtt');
var HOST = '192.168.43.10';
var client = mqtt.connect("mqtt:\/\/" + HOST, { port: 1883 });
client.on('connect', function () {
console.log("Connected to " + HOST);
client.subscribe('hermes/intent/#');
});
View pengicorn.iso
#include <Wire.h>
#include "SH1106Wire.h"
#include <Adafruit_NeoPixel.h>
#define PIN 0
Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, PIN, NEO_GRB + NEO_KHZ800);
int brightness = 4;
/*
default arduino esp8266 pinout for I2C
View candle.ino
/*
Program Description: This program reads a light detecting resistor thru an internal ADC and stores the value,
after scaling it, to eeprom. This ADC value is sent to a PWM channel with attached led. This is essentially a data logger
for light and replay by LED. If, if you aim the LDR at a flickering candle during its recording phase, you have a flickering
led candle.
A circuit description and other details can be found at http://petemills.blogspot.com
Filename: ATTiny_Candle_v1.0.c
Author: Pete Mills
View tiny_LS_cp_short_buffer_2.ino
/*
Based on https://github.com/maltesemanTS1/Charlieplexing-the-Arduino
http://arduino.cc/en/Tutorial/BitMask
*/
int16_t shifter = 0;
uint8_t shifter_factor = 4; // also speed influence
bool toggle = true;
const uint8_t max_leds = 20;
View tiny_LS_cp_short_buffer
/*
Based on https://github.com/maltesemanTS1/Charlieplexing-the-Arduino
http://arduino.cc/en/Tutorial/BitMask
*/
int16_t shifter = 0;
uint8_t shifter_factor = 8; // also speed influence
bool toggle = true;
const uint8_t max_leds = 20;
View tiny_larson_scanner.ino
/*
Based on https://github.com/maltesemanTS1/Charlieplexing-the-Arduino
http://arduino.cc/en/Tutorial/BitMask
*/
int16_t shifter = 0;
uint8_t shifter_factor = 8; // also speed influence
bool toggle = true;
const uint8_t max_leds = 20;
View ESP_tindie_API.ino
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <ArduinoJson.h>
/*
SHA1 fingerprints found in certificate
*/
// tindie
String url = "/api/v1/order/?limit=1&shipped=false&format=json&username=davedarko&api_key=YOURAPIKEY";
const char* host = "www.tindie.com";
@davedarko
davedarko / neopixel_clock.ino
Created Jun 2, 2018
Unexpected Maker Neo7Segment binary clock
View neopixel_clock.ino
#include <Wire.h>
#include <Time.h>
#include <TimeLib.h>
#include <DS3232RTC.h>
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
@davedarko
davedarko / deauther_killer.ino
Created Jan 16, 2018
Arduino Script to auto connect to deauthers by spacehuhn with standard passwords and replaces them with whatever you want.
View deauther_killer.ino
#include <ESP8266WiFi.h>
WiFiClient client;
const char* ssid = "pwned";
const char* password = "deauther";
const char* host = "192.168.4.1";
void setup()
{
Serial.begin(115200);
You can’t perform that action at this time.