Skip to content

Instantly share code, notes, and snippets.

View BradleyJohnson's full-sized avatar

Bradley Johnson BradleyJohnson

View GitHub Profile
@BradleyJohnson
BradleyJohnson / colors.go
Created October 11, 2020 19:15 — forked from ik5/colors.go
Simple golang expirement with ANSI colors
package main
// http://play.golang.org/p/jZ5pa944O1 <- will not display the colors
import "fmt"
const (
InfoColor = "\033[1;34m%s\033[0m"
NoticeColor = "\033[1;36m%s\033[0m"
WarningColor = "\033[1;33m%s\033[0m"
ErrorColor = "\033[1;31m%s\033[0m"
DebugColor = "\033[0;36m%s\033[0m"
@BradleyJohnson
BradleyJohnson / docker-xenial-pg12-setup
Last active November 5, 2020 20:35
stock xenial pg12 docker image and reproduce collation error
# Start stock xenial
> docker run -it ubuntu:xenial bash
# Prepare image
apt-get update \
&& apt-get install vim software-properties-common wget apt-transport-https
add-apt-repository -y "deb https://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
// ==UserScript==
// @name Highlight no responses
// @namespace https://support.heroku.com/
// @version 0.1
// @description Highlight no responses
// @author Jon McCartie
// @include https://support.heroku.com/tags/*
// @grant none
// ==/UserScript==
$('.row.ticket').each(function(index, value) {
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'the_geek'
require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: true)
RSpec.configure do |config|
config.before(:each) do
stub_request(:get, /www.boardgamegeek.com/).
with(headers: {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
@BradleyJohnson
BradleyJohnson / install_ruby_rpi.sh
Created March 20, 2016 00:45 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.3 on the Raspberry Pi (Raspbian)
#!/bin/bash
# -----------------------------------------------------------------------
# Installs Ruby 2.3 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s raw_script_url_here)
# -----------------------------------------------------------------------
# Set up variables
require 'google/apis/gmail_v1'
require 'uri'
require 'mail'
Gmail = Google::Apis::GmailV1
class MailService
def initialize(params)
@params = params
Physics(function (world) {
var viewportBounds = Physics.aabb(0, 0, window.innerWidth, window.innerHeight)
,edgeBounce
,renderer
;
renderer = Physics.renderer('canvas', {
el: 'viewport'
});