Skip to content

Instantly share code, notes, and snippets.

View conoro's full-sized avatar

Conor O'Neill conoro

View GitHub Profile
@conoro
conoro / mattermost-rssfeeds.go
Last active January 24, 2016 19:45
An RSS feed subscription tool for Mattermost. Barely started. Does not work yet.
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@conoro
conoro / rhmapusers-email-extract.go
Last active October 11, 2016 08:58
RHMAP Studio email extractor for Mailshots
/*
RHMAP Studio email extractor for Mailshots
Copyright Conor O'Neill 2016, [email protected]
MIT License https://opensource.org/licenses/MIT
You may need to create a User API key in your Profile in the Studio called X-FH-AUTH-USER
Then:
@conoro
conoro / Oven_Thermometer_Dec2015.ino
Created December 31, 2015 16:50
Oven Thermometer using Arduino with Teensy 3.1, K-Type Thermocouple, DS1307 Realtime Clock, Adafruit AD8495 and ILI9341 TFT
// Temperature from AD8495 K-type Thermocoule adapter and Datetime from DS1307 RTC. Displayed on ILI9341 LCD.
//
// MIT License (MIT)
// Copyright (c) 2015 Conor O'Neill
// Portions copyright Limor Fried/Ladyada for Adafruit Industries and others
// Portions copyright Paul Stoffregen
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
@conoro
conoro / bandonfews-tweets.go
Last active January 11, 2017 11:14
Bandon FEWS Tweets
// Copyright Conor O'Neill 2016. [email protected]
// cd /home/centos/gitwork/go/src/github.com/conoro/bandonfews-tweets/
// go build github.com/conoro/bandonfews-tweets
// go install github.com/conoro/bandonfews-tweets
// sudo systemctl restart bandonfews-tweets
package main
import (
"encoding/json"
@conoro
conoro / GoImports.py
Created December 10, 2015 16:33
Fixed version of GoImports main code for Sublime Text 3 on Windows
"""
Sublime Text 3 plugin to update list of packages imported
in a Go (golang) source file (scope: source.go) using 'goimports'
(http://github.com/bradfitz/goimports)
Author: Hamid Ghadyani
URL: https://github.com/spamwax/goimports-sublime-text-3
"""
import sublime
@conoro
conoro / wines.js
Created December 7, 2015 17:55
MySQL Connection Pooling and Data Format for RHMAP Forms
var express = require('express');
var bodyParser = require('body-parser');
var cors = require('cors');
var mysql = require('mysql');
var pool = mysql.createPool({
connectionLimit : 100, //important
host : process.env.MYSQL_HOST,
user : process.env.MYSQL_USERNAME,
password : process.env.MYSQL_PASSWORD,
@conoro
conoro / openwrt_go.patch
Created November 15, 2015 14:17
Diff to add Go 1.1.2 support to OpenWRT (as of 15/11/2015)
diff -ur orig/package/libs/toolchain/Makefile new/package/libs/toolchain/Makefile
--- orig/package/libs/toolchain/Makefile 2015-11-10 08:09:30.086903500 +0000
+++ new/package/libs/toolchain/Makefile 2015-11-15 14:02:44.125873000 +0000
@@ -254,6 +254,33 @@
endmenu
endef
+define Package/libgo
+$(call Package/gcc/Default)
+ TITLE:=Go support library
@conoro
conoro / DoorBell_Scream_01.ino
Last active November 8, 2015 13:32
DoorBell Scream 01
// Extra Halloween code Conor O'Neill 2015
// Note there is a debounce error in here where the doorbell has to be pressed twice.
/***************************************************
This is an example for the Adafruit VS1053 Codec Breakout
Designed specifically to work with the Adafruit VS1053 Codec Breakout
----> https://www.adafruit.com/products/1381
Adafruit invests time and resources providing this open source code,
@conoro
conoro / rgbled-go.go
Created November 8, 2015 11:50
Control H801 Wifi RGB LED Controller from Go
package main
import (
"fmt"
. "github.com/hugozhu/rpi"
"net"
"time"
)
func CheckError(err error) {
@conoro
conoro / HugoFlatten.go
Created October 5, 2015 12:48
This tool takes a directory tree with directory names as <slug> and leaf files as index.md and changes it to a set of <slug>.md files for use in Hugo
/*
This tool takes a directory tree with directory names as <slug> and leaf files
as index.md and changes it to a set of <slug>.md files for use in Hugo
The MIT License (MIT)
Copyright (c) 2015 Conor O'Neill ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights