Skip to content

Instantly share code, notes, and snippets.

sam0737 / clock.html
Last active April 25, 2024 12:24
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<meta charset="UTF-8">
<title>A simple clock</title>
<body translate="no" >
SeeJayDee / tiny_IRremote.cpp
Last active February 21, 2023 12:19
tiny_IRremote - Arduino IRremote ported to the ATtiny
* tiny_IRremote
* Version 0.2 July, 2016
* Christian D'Abrera
* Fixed what was originally rather broken code from
* ...itself based on work by Ken Shirriff.
* This code was tested for both sending and receiving IR on an ATtiny85 DIP-8 chip.
* IMPORTANT: IRsend only works from PB4 ("pin 4" according to Arduino). You will need to
* determine which physical pin this corresponds to for your chip, and connect your transmitter
tetkuz / main.c
Last active March 18, 2020 20:54
#include <gst/gst.h>
static void
fakesink_handoff (GstElement* object, GstBuffer* arg0, GstPad* arg1, gpointer data)
static gint cnt=0;
GstElement *pipeline = GST_ELEMENT(data);
Vestride /
Last active May 17, 2024 06:55
Encoding video for the web

Encoding Video


Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
igrr / esp8266_pubsubclient.ino
Created January 6, 2015 23:44
PubSubClient sample for ESP8266 Arduino
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
const char* ssid = ".................";
const char* password = "................";
char* topic = "esp8266_arduino_out";
char* server = "";
tomerweller / minim_in_level
Created July 5, 2014 15:41
read RMS amplitude of input audio stream
import ddf.minim.*;
Minim minim;
AudioInput in;
void setup()
minim = new Minim(this);
in = minim.getLineIn();
abythell /
Last active May 22, 2023 18:40
Bash script to install a Thingspeak server on Ubuntu Server 12.04. Raspbian (2014-01-07-wheezy-raspbian). and possibly Debian-based distros.
# Automatic install of Thingspeak server on Ubuntu 12.04 / Raspbmc / Debian (?)
# Updated to use ruby 2.1.4
## Install required packages
sudo apt-get update
sudo apt-get -y install build-essential git mysql-server mysql-client libmysqlclient-dev libxml2-dev libxslt-dev libssl-dev libsqlite3-dev
## Install ruby
//T5 Analog Outputs
const ON=1
const OFF=0
// Array that holds the state of each pin
pinState <- [ 0, 0, 0, 0, 0, 0];
// Pins array channel 1 is channelPin[0] in array
Pins <- [ hardware.pin1, hardware.pin2, hardware.pin5, hardware.pin7, hardware.pin8, hardware.pin9 ];
// Register imp
cat-haines / agent.button.js
Last active December 20, 2015 19:59
This GIST has four files and demonstrates how data can be passed from one imp to another using HTTP requests, and HTTP request handlers.
const otherAgentUrl = "";
// create a handler for the "button" message from the device
device.on("button", function(state) {
local url = otherAgentUrl + "?led=" + state;
server.log("sending request to " + url);
// create the request
local request = http.get(url);
// send the request
gdamjan /
Last active May 3, 2024 07:59
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.


A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).