Skip to content

Instantly share code, notes, and snippets.

View ctalkington's full-sized avatar

Chris Talkington ctalkington

View GitHub Profile
@ctalkington
ctalkington / Gemfile
Last active May 16, 2023 20:19
Nginx, Sinatra, and Puma.
source :rubygems
gem "puma"
gem "sinatra"
#!/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
@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:
@ctalkington
ctalkington / grunt.js
Created September 12, 2012 02:44
Grunt Glob to Multi Files Object
// gruntfile dropin used to build a grunt files object with 1:1 structure
function globToMultiFiles(glob, dest, options) {
var path = require('path');
grunt.util = grunt.util || grunt.utils;
dest = grunt.template.process(dest);
options = grunt.util._.defaults(options || {}, {
cwd: '',
# 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 / README.md
Last active March 21, 2020 09:27
Observium BIND Unix Agent

Observium BIND 9.6 Unix Agent

This collection of scripts is designed for BIND 9.6+ and the SVN version of Observium. Only tested on one machine at this point in time so YMMV.

Files

  • agent-local -> scripts/agent-local/bind
  • app-bind.inc.php -> html/pages/device/apps/bind.inc.php
  • graph-bind_queries.inc.php -> html/includes/graphs/application/bind_queries.inc.php
  • graph-bind_queries_by_type.inc.php -> html/includes/graphs/application/bind_queries_by_type.inc.php
@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:

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) {