Skip to content

Instantly share code, notes, and snippets.

View damoclark's full-sized avatar

Damien Clark damoclark

View GitHub Profile
@damoclark
damoclark / php_unserialize_to_json.sql
Last active February 3, 2021 09:26 — forked from storeman/php_unserialize_to_json.sql
PHP unserialize in Postgresql to json
/**
Decode a php serialized value to json. This function only supports basic
data types:
- arrays (will always become a json object)
- booleans
- integers
- floats
- strings
- NULL
@damoclark
damoclark / io.adafruit.com-bridge.conf
Last active December 15, 2016 00:37 — forked from tdack/io.adafruit.com-bridge.conf
Bridge Mosquitto MQTT broker to io.adafruit.com MQTT broker to use with io.adafruit.com
# Connection name
connection adafruit
# Secure SSL/TLS
address io.adafruit.com:8883
# adjust path as approriate to point to directory with PEM encoded .crt CA files
bridge_capath /etc/ssl/certs/
# For CentOS 7 (and other RHEL derivatives), use this directive instead of bridge_capath
# bridge_cafile /etc/ssl/certs/ca-bundle.crt
@damoclark
damoclark / GM_XHR.js
Last active January 15, 2016 04:04 — forked from monperrus/GM_XHR.js
allows using all Jquery AJAX methods in Greasemonkey
// allows using all Jquery AJAX methods in Greasemonkey
// https://gist.github.com/damoclark/f01b957797b7dd2c33d6
// https://gist.github.com/monperrus/999065
// inspired from http://ryangreenberg.com/archives/2010/03/greasemonkey_jquery.php
// works with JQuery 1.5
// (c) 2016 Damien Clark
// (c) 2011 Martin Monperrus
// (c) 2010 Ryan Greenberg
//
// Example usage with JQuery:
@damoclark
damoclark / autopgsqlbackup
Created October 22, 2015 01:04 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@damoclark
damoclark / global.gitignore
Last active July 27, 2018 04:39 — forked from octocat/.gitignore
My global git ignore file, added with command git config --global core.excludesfile <path to this file>
#global git ignore file, add with command git config --global core.excludesfile <path to this file>
# Testing scripts #
###################
test-*.php
# Typescripts #
###################
typescript*