Skip to content

Instantly share code, notes, and snippets.

@mybigman
mybigman / australian-postcodes.sql
Created April 9, 2017 05:51 — forked from randomecho/australian-postcodes.sql
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@mybigman
mybigman / webpack.config.js
Created July 9, 2018 13:35 — forked from imsus/webpack.config.js
Webpack + Browsersync + Vue Loader
var path = require('path');
var webpack = require('webpack');
var BrowserSyncPlugin = require('browser-sync-webpack-plugin');
var x = 1;
module.exports = {
entry: './src/main.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
@mybigman
mybigman / null_pattern.php
Created October 24, 2018 00:19 — forked from eric1234/null_pattern.php
A null object pattern implemented in PHP
<?php
# Implements a recursive null object pattern.
#
# Implemented as a trait so any object can make it's properties use
# the null pattern without resorting to inheritance.
#
# The goal is so you can pull data off a partially populated object
# without excessive existance checks.
trait NullPattern {
@mybigman
mybigman / blink.cpp
Created April 25, 2019 05:27 — forked from FrankBuss/blink.cpp
general class to simplify the syntax to write to a pin
@mybigman
mybigman / AsyncWebUpdate.ino
Created April 27, 2019 05:41 — forked from JMishou/AsyncWebUpdate.ino
ESPAsyncWebServer webupdate
/*
__/\\\\____________/\\\\__/\\\\\\\\\\\_____/\\\\\\\\\\\____/\\\________/\\\_
_\/\\\\\\________/\\\\\\_\/////\\\///____/\\\/////////\\\_\/\\\_______\/\\\_
_\/\\\//\\\____/\\\//\\\_____\/\\\______\//\\\______\///__\/\\\_______\/\\\_
_\/\\\\///\\\/\\\/_\/\\\_____\/\\\_______\////\\\_________\/\\\\\\\\\\\\\\\_
_\/\\\__\///\\\/___\/\\\_____\/\\\__________\////\\\______\/\\\/////////\\\_
_\/\\\____\///_____\/\\\_____\/\\\_____________\////\\\___\/\\\_______\/\\\_
_\/\\\_____________\/\\\_____\/\\\______/\\\______\//\\\__\/\\\_______\/\\\_
_\/\\\_____________\/\\\__/\\\\\\\\\\\_\///\\\\\\\\\\\/___\/\\\_______\/\\\_
_\///______________\///__\///////////____\///////////_____\///________\///__
@mybigman
mybigman / WiFiAutoSelector.h
Created May 3, 2019 13:11 — forked from AndiSHFR/WiFiAutoSelector.h
ESP8266 : WiFiAutoSelector - Pick wifi with best signal from a list and connect to it.
/**
* WiFiAutoSelector.h - Include file for class WiFiAutoSelector
* Copyright (c) 2016 Andreas Schaefer <asc@schaefer-it.net>
*
* A class to pick a wifi network from a list, based on the
* highest receive signal strength, and connect to it.
* Inspired by "WiFiMulti"
*
* This source code is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@mybigman
mybigman / HumanReadableDuration.c
Created May 3, 2019 13:15 — forked from AndiSHFR/HumanReadableDuration.c
Converts a duration in seconds into a human readable string.
/**
* HumanReadableDuration
*
* Retruns a human readable duration for totalSeconds.
* Make sure outputBuffer is big enough to hold the
* complete string incl. temrinate '\0' character.
*/
char* HumanReadableDuration(unsigned long totalSeconds, char* outputBuffer ) {
if(outputBuffer) {
@mybigman
mybigman / GetOnboardTemperature.c
Created May 3, 2019 13:16 — forked from AndiSHFR/GetOnboardTemperature.c
Read internal ATmega cpu temperature sensor.
/**
* GetOnboardTemperature
*
* Read temperature from the onbaord sensor. Check specs if sensor exist for your cpu. ;-)
*
* Example:
* char buff[10];
* Serial.print("CPU temp.: " );
* Serial.print(dtostrf(GetOnboardTemperature(), 5, 2, buff));
/**
* PulseHeartbeat
*
* Blink the onboard LED to signal "Yepp, we are still runnning".
* The onbaord LED is on pin 13 and so pin 13 will be set to OUTPUT.
*
* Call this at the beginning of your loop() function.
* Caution: Will only work if millis() if functional and no one else
* did hook up timer0.
*/
@mybigman
mybigman / 00-cloud-config.yml
Created May 18, 2019 06:00 — forked from janeczku/00-cloud-config.yml
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher