Skip to content

Instantly share code, notes, and snippets.

View gdunstone's full-sized avatar

Gareth Dunstone gdunstone

View GitHub Profile
This script allows you to scrape a Facebook page for live videos, and generate a iframe embed code for your website. It uses Selenium Firefox web driver. You may get banned if you run this too often - this is yet to be seen.
The file `livestream-data.json` will be updated with extra fields if/when a live video is found.
@gdunstone
gdunstone / arduinogps.ino
Created January 12, 2019 10:43
arduino gps speedo.
#include <Adafruit_SSD1306.h>
#include <NMEAGPS.h>
Adafruit_SSD1306 display(128, 64, &Wire, 4);
static NMEAGPS gps;
void setup() {
Serial.begin( 9600 );
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
@gdunstone
gdunstone / heltecGPS.ino
Created January 10, 2019 03:42
heltec GPS
#include <Wire.h> // Only needed for Arduino 1.6.5 and earlier
#include "SSD1306.h" // alias for `#include "SSD1306Wire.h"`
#define SDA 4
#define SCL 15
#define RST 16 //RST must be set by software
#define DISPLAY_HEIGHT 64
#define DISPLAY_WIDTH 128
SSD1306 display(0x3c, SDA, SCL, RST);
float speed_kmh = 0.0;
@gdunstone
gdunstone / ethernet_DHT22.ino
Created July 10, 2018 07:02
ethernet dht22
#include <DHT.h>
#include "ArduinoJson.h"
#define DHTTYPE DHT22
#define DHTPIN 7
//#include <Dhcp.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
// #include <msgpck.h>
@gdunstone
gdunstone / ethernet_BME280.ino
Last active July 10, 2018 07:01
ethernet bme280
#include "ArduinoJson.h"
//#include <Dhcp.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
//#include <msgpck.h>
#include <CRC32.h>
#include <DFRobot_BME280.h>
@gdunstone
gdunstone / bme280-arduino-msgpack.ino
Last active July 9, 2018 01:01
bme280 msgpack program
// libraries
// https://github.com/bakercp/CRC32
// https://github.com/DFRobot/DFRobot_BME280
// https://github.com/HEADS-project/arduino_msgpack
#include <CRC32.h>
#include <DFRobot_BME280.h>
#include <msgpck.h>
client
dev tun
proto udp
remote 130.56.244.173 1195
resolv-retry infinite
persist-key
persist-tun
remote-cert-tls server
@gdunstone
gdunstone / clipse.css
Created October 8, 2017 23:11
bloom eclipse loader no animation
.loader {
position: relative;
margin: 10% auto;
height: 50vh;
width: 50vh;
border-radius: 100%;
background-color: black;
}
.loader::after{
position: absolute;
@gdunstone
gdunstone / client.go
Last active August 2, 2017 15:55
surgemq simpleserver and chill client
package main
import (
"fmt"
"github.com/surge/glog"
"github.com/surgemq/message"
"github.com/surgemq/surgemq/service"
"time"
)
@gdunstone
gdunstone / ANU-Secure
Created July 21, 2017 04:12
netctl anu secure
# to generate hash:
# tr -d '[:space:]' | iconv -t utf16le | openssl md4
Description='ANU-Secure'
Interface=interface
Connection=wireless
Security=wpa-configsection
IP=dhcp
WPAConfigSection=(
'ssid="ANU-Secure"'
'key_mgmt=WPA-EAP'