Skip to content

Instantly share code, notes, and snippets.

@bytespider
bytespider / gateway.ino
Created December 5, 2017 17:13
ESP NOW
/**
*
* Author: Andreas Spiess, 2017
* Author: Rob Griffiths
*
This sketch receives ESP-Now message and sends it as an MQTT messge
It is heavily based on of Anthony's gateway setch sketch
https://github.com/HarringayMakerSpace/ESP-Now
Anthony Elder
@bytespider
bytespider / imagick_transparency.php
Created November 8, 2016 10:40
Setting the background colour of a transparent PNG when converted to JPEG
<?php
$image = new Imagick('kiwi.png'); // https://s13.postimg.org/hakfstg1j/kiwi.png
$image->setImageBackgroundColor(new ImagickPixel('white')); // set the background color of the image
$image->setImageAlphaChannel(Imagick::ALPHACHANNEL_BACKGROUND); // ALPHACHANNEL_BACKGROUND is undocumented and has a value of 2
// save a JPEG
$image->setImageFormat('jpeg');
$image->setImageCompression(Imagick::COMPRESSION_JPEG);
#!/bin/bash
PORT=2222
if [ ${VAGPORT} ]; then
PORT=${VAGPORT}
fi
IFS=$'\n'
SSH_CONFIG=($(vagrant ssh-config $1 | sed -e 's/^ *//' -e 's/ *$//'))
#!/bin/bash
PORT=2222
if [ ${VAGPORT} ]; then
PORT=${VAGPORT}
fi
IFS=$'\n'
SSH_CONFIG=($(vagrant ssh-config $1 | sed -e 's/^ *//' -e 's/ *$//'))
public function autoLinkText($text)
{
// a more readably-formatted version of the pattern is on http://daringfireball.net/2010/07/improved_regex_for_matching_urls
$pattern = '/((https?):\/\/)?([\da-z\.-]+\.[a-z\.]+)([\/\w \.-]+)*\/?/i';
$callback = function($matches) {
$url = array_shift($matches);
if (is_null(parse_url($url, PHP_URL_SCHEME))) {
$url = 'http://' . $url;
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func main() {
r := mux.NewRouter()

Keybase proof

I hereby claim:

  • I am bytespider on github.
  • I am bytespider (https://keybase.io/bytespider) on keybase.
  • I have a public key whose fingerprint is AB4E 0D5B C744 98E8 14EE E8D7 1642 B2DF 12CE 8036

To claim this, I am signing this object:

[
{
"keys": ["enter"],
"command": "run_macro_file",
"args": {
"file": "res://Packages/Default/Add Line in Braces.sublime-macro"
},
"context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage showvminfo debian --machinereadable
name="debian"
groups="/"
ostype="Debian (64 bit)"
UUID="323105ea-d8f6-4898-ae9e-459b3d642b23"
CfgFile="/Users/rgrif/VirtualBox VMs/debian/debian.vbox"
SnapFldr="/Users/rgrif/VirtualBox VMs/debian/Snapshots"
LogFldr="/Users/rgrif/VirtualBox VMs/debian/Logs"
hardwareuuid="323105ea-d8f6-4898-ae9e-459b3d642b23"
@bytespider
bytespider / gwladys_street_trading_number.txt
Last active December 29, 2015 17:39
Gwladys Street Trading. They spammy mother fuckers need reporting. Collecting all offending numbers owned by them.
07730 217 054
07730 217 064
07730 217 073
07730 217 076
07730 217 080
07730 217 093
07730 217 098
07730 217 100
07730 217 117
07730 217 131