Skip to content

Instantly share code, notes, and snippets.

View Floppy's full-sized avatar
💾

James Smith Floppy

💾
View GitHub Profile
@Floppy
Floppy / homeassistant_configuration..yaml
Last active June 14, 2021 20:33
Ansible files for Joggler dashboard configuration
homeassistant:
customize: !include customize.yaml
auth_providers:
# Don't require login on local network
- type: trusted_networks
trusted_networks:
- 192.168.1.0/24
- 2001:xxxx:xxxx::/64
- fe80::/10
allow_bypass_login: true
@Floppy
Floppy / IDs.js
Last active February 6, 2018 09:09
const sectorOptions = [
'academia',
'media',
'business',
'public-service',
'international',
'non-profit',
];
const expertiseOptions = [
Verifying that +floppy76 is my blockchain ID. https://onename.com/floppy76
@output = []
companyreader.each_with_index do |row, row_index|
# Check the line has a postcode
next if row['RegAddress.PostCode'].blank?
postcode = Postcode(row['RegAddress.PostCode'],db)
next unless postcode.current?
lines = [row['RegAddress.AddressLine1'], row['RegAddress.AddressLine2'], row['RegAddress.PostTown'], row['RegAddress.County']]

Keybase proof

I hereby claim:

  • I am floppy on github.
  • I am floppy (https://keybase.io/floppy) on keybase.
  • I have a public key whose fingerprint is FD95 A574 673E CCB9 4A26 7169 DAB8 61E4 501F 794C

To claim this, I am signing this object:

@Floppy
Floppy / invalid.csv
Last active August 29, 2015 13:56
Test data
1234 bob@example.org
Alice 5 alice@example.com
@Floppy
Floppy / word-diff.md
Last active December 19, 2015 13:58
Misadventures in word-diff

I'm trying to write a CSV-compatible diff for git, using word-diff, so that I can see things like added columns easily.

In .gitattribues I've added:

*.csv   diff=csv

And in .git/config I've added:

[diff "csv"]
@Floppy
Floppy / .bash_profile
Last active January 16, 2019 02:27
My ~/.bash_profile, with handy command-prompt display of ruby version, gemset, and git branch.
ESC="\033" # This is the escape sequence
NO_COLOR="$ESC[0m"
IRED="$ESC[1;31m" # ANSI color code for intense/bold red
IGRN="$ESC[1;32m" # ANSI color code for intense/bold green
# From http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/
# I had to change 'git-symbolic-ref' to 'git symbolic-ref'
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " ["${ref#refs/heads/}"]" # I wanted my branch wrapped in [], use () or <> or whatever
@Floppy
Floppy / array_ext.rb
Created August 1, 2012 16:11
ActiveRecord-style array filtering
#!/usr/bin/env ruby
# ArrayExt shows how to extend Array to support activerecord-style
# filter chaining.
class ArrayExt
# When we create the ArrayExt, we store the actual array
# we want to operate on internally
def initialize(finder)
@Floppy
Floppy / google_maps_carbon.user.js
Created September 12, 2009 07:14
A GreaseMonkey script that uses AMEE to add carbon emissions to car journeys in Google Maps (click "raw" to install if you have GreaseMonkey, and then edit to put in your AMEE key details)
// ==UserScript==
// @name Google Maps Carbon
// @namespace http://www.amee.com
// @include http://maps.google.*/
// ==/UserScript==
// Created by James Smith, AMEE - help@amee.cc
// Public domain, do what you like :)
// Once you've installed the greasemonkey script (click "raw" on the top