Skip to content

Instantly share code, notes, and snippets.

View ctalkington's full-sized avatar

Chris Talkington ctalkington

View GitHub Profile
#!/bin/bash
if ! [ -x "$(command -v jq)" ]; then
printf "\x1B[31m[ERROR] jq is not installed.\x1B[0m\n"
exit 1
fi
if ! [ -x "$(command -v sed)" ]; then
printf "\x1B[31m[ERROR] sed is not installed (only GNU sed works).\x1B[0m\n"
exit 1
# pylint: disable=W0621
"""Asynchronous Python client for IPP."""
import asyncio
from pyipp import IPP
async def main():
"""Show example of connecting to your IPP print server."""
async with IPP("ipp://HP79EC40.local:631/ipp/printer") as ipp:
@ctalkington
ctalkington / main.yaml
Last active December 24, 2019 04:46
WLED GH Actions WIP
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
@ctalkington
ctalkington / bulb_75w_rgbw_qpw06.yaml
Last active November 23, 2021 12:24
Merkury A21 75W Bulb ESPHome Config (requires v1.14+)
esphome:
name: bulb_75w_rgbw_qpw06
platform: ESP8266
board: esp01_1m
wifi:
ssid: 'YOURWIFISSID'
password: 'YOURWIFIPASSWORD'
logger:

Keybase proof

I hereby claim:

  • I am ctalkington on github.
  • I am ctalkington (https://keybase.io/ctalkington) on keybase.
  • I have a public key ASCX5Kq7AzpGKw26Dbyn4XkXAoNTo4jRi3rCS7XP0_IxIAo

To claim this, I am signing this object:

@ctalkington
ctalkington / lock-plugin-updates.php
Last active October 19, 2016 00:16
Block WordPress Plugin Updates - best placed in wp-content/mu-plugins/
<?php
/*
Plugin Name: Lock Plugin Updates
Description: Allow blocking plugins from being updated.
Version: 1.0.0
Author: Example
Author URI: https://www.example.com/
@author John Doe
*/
@ctalkington
ctalkington / functions.styl
Created November 4, 2014 00:23
Foundation 5 - Stylus Functions
// This is the default html and body font-size for the base rem value.
$rem-base ?= 16px;
// CT: Stylus Compat
sif($res, $t, $f) {
return ($res) ? $t : $f;
}
// CT: Stylus Compat
nth($hash, $index) {
@ctalkington
ctalkington / components-modules-plesk-language-en_us-plesk.php
Last active August 29, 2015 14:06
Blesta - Patch for Forum Post #3279
<?php
// Errors
$lang['Plesk.!error.simplexml_required'] = "The simplexml extension is required for this module.";
$lang['Plesk.!error.api.internal'] = "An internal error occurred, or the server did not respond to the request.";
$lang['Plesk.!error.server_name.empty'] = "You must enter a Server Label.";
$lang['Plesk.!error.host_name.valid'] = "The Hostname appears to be invalid.";
$lang['Plesk.!error.ip_address.valid'] = "The IP address appears to be invalid.";
$lang['Plesk.!error.port.format'] = "The port number must be a number.";
@ctalkington
ctalkington / app-controllers-billing.php
Last active August 29, 2015 14:06
Blesta - Patch for Forum Post #3280
<?php
/**
* Admin Billing Management
*
* @package blesta
* @subpackage blesta.app.controllers
* @copyright Copyright (c) 2010, Phillips Data, Inc.
* @license http://www.blesta.com/license/ The Blesta License Agreement
* @link http://www.blesta.com/ Blesta
*/
@ctalkington
ctalkington / index.js
Created September 3, 2013 02:55
ref ctalkington/node-archiver #44
var fs = require('fs')
var path = require('path')
var zlib = require('zlib')
var ls = require('ls-stream')
var archiver = require('archiver')
var lazystream = require('lazystream')
module.exports = streamFolder
function streamFolder(dir) {