Skip to content

Instantly share code, notes, and snippets.

View choffee's full-sized avatar

John Cooper choffee

View GitHub Profile
@choffee
choffee / ddg.bb
Last active April 16, 2024 10:14
Cli tool for selecting DuckDuckGo bang searches unsing Babashka and gum.
#!/usr/bin/env bb
;; Script to search ddg.
;; Takes a search term then asks you to select a bang.
;; Copyright John Cooper
;; This program is free software: you can redistribute it and/or modify it under the terms of the
;; GNU General Public License as published by the Free Software Foundation,
;; either version 3 of the License, or (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@choffee
choffee / Vagrantfile
Created September 14, 2016 10:52
Psi-probe Vagrant box for simple test.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Basic tomcat box running Psi-probe from https://github.com/psi-probe/psi-probe/
# It's an extension to the tomcat manager that is easier to use and has a few
# more features.
Vagrant.configure("2") do |config|
# Ubuntu don't test their builds so this is often broken.
#config.vm.box = "ubuntu/xenial64"

Keybase proof

I hereby claim:

  • I am choffee on github.
  • I am choffee (https://keybase.io/choffee) on keybase.
  • I have a public key whose fingerprint is D060 3466 ABA3 9477 0881 796C B049 4044 9A9B D985

To claim this, I am signing this object:

@choffee
choffee / Makefile
Last active January 19, 2016 22:23
# Makefile for OpenScad
#
# Copy of http://social.gl-como.it/display/3e3ce0df2355b11e6937f69900231262
#
BUILDDIR = build
CONFDIR = conf
SRCDIR = src
SLIC3R = slic3r
@choffee
choffee / cheerlights_to_hipchat
Created January 5, 2016 11:06
Post the cheerlight color to a hipchat room.
#!/bin/bash
# Expects some env variables set
readonly auth_token="${HIPCHAT_AUTH_TOKEN}"
readonly room="${HIPCHAT_CHEER_ROOM}"
if [[ s"$auth_token" == "s" ]] ; then
echo "You need to set HIPCHAT_AUTH_TOKEN and HIPCHAT_CHEER_ROOM"
echo "environment variables"
echo "Get your auth token from: https://www.hipchat.com/docs/apiv2"
[profile]
layer_height = 0.3
wall_thickness = 1
retraction_enable = True
solid_layer_thickness = 0.6
fill_density = 20
print_speed = 35
print_temperature = 0
print_temperature2 = 0
print_temperature3 = 0
@choffee
choffee / Spark_core_mqtt.ino
Created February 1, 2015 22:33
Kitchen SparkCore to MQTT bridge
// This #include statement was automatically added by the Spark IDE.
#include "MQTT/MQTT.h"
// Define the pins we're going to call pinMode on
const int led_red = A5;
const int led_green = A4; // This one is the built-in tiny one to the right of the USB jack
const int led_blue = A6;
const int number_of_inputs = 4;
int inputs[] = { D1, D2, D3, D4};
@choffee
choffee / Cheerlight-rainbowduino.ino
Created December 4, 2014 09:21
Simple code for rainbowduino to change colour in response to a serial command for cheerlights
/*
Rainbowduino v3.0 Library examples : Mood Lamp
*/
#include <Rainbowduino.h>
// HSV to RGB array generated using the following perl script
@choffee
choffee / Onename verify
Created July 29, 2014 15:36
Onename verify
Verifying myself: My Bitcoin username is +choffee. https://onename.io/choffee
#!/usr/bin/env python
import time
from time import sleep
import Adafruit_Nokia_LCD as LCD
import Adafruit_GPIO.SPI as SPI
import Adafruit_BBIO.GPIO as GPIO
import Image