Skip to content

Instantly share code, notes, and snippets.

View equivalentideas's full-sized avatar

Luke Bacon equivalentideas

View GitHub Profile
equivalentideas /
Created February 7, 2018 08:32
Outline for Working with spreadsheets, Free Class at Frontyard Projects

2018-02-05 Working with spreadsheets, Free Class at Frontyard Projects

Session Outline

  • What is data?
    • Things and their attributes
    • How do spreadsheets present data? Rows and columns, things and attributes
    • Example, plants? Coconut tree, fig tree, parsley, strawberry, silver beat
    • Why use a spreadsheet to work with this data? Graphic and usable way to build and organise data
  • Quick and powerful analysis tool
equivalentideas / slack_reactions_from_export.rb
Created November 7, 2017 00:04
Extract a list of all the reactions to messages from a Slack data export
# Put this script in the root directory of a Slack data export
# Run `bundle install` and then `bundle exec ruby slack_reactions_from_export.rb`
# This will create a file called `reactions.txt` with rows like this:
# 2017-04-09 9:56 in #general: 😀
# 2017-04-10 9:45 in #tech-discussions: ⚽️
# 2017-04-19 15:45 in #general: 💖
# 2017-04-20 11:59 in #general: :hugging_face:
# 2017-04-20 22:35 in #general: 🤕
# 2017-04-30 21:38 in #most17: ❤️❤️
equivalentideas / Rebooting production Linode
Last active October 2, 2017 10:28
Runsheet for rebooting the current production server

Rebooting the production server

  1. Log into Linode and go to the page for
  2. Go to the Remote Access tab and to Console Access at the bottom of that page
  3. There’s a command there called ‘Lish via SSH’
  4. Copy that to your local shell and run it. You should now see the output of the machine, processes running, dying etc.
  5. In another shell session ssh to
  6. Try the light touch first, run reboot there
    • If you switch to the lish session, you will see processes start shutting down in the linode console access session
  • after a minute that may become stuck on a command
equivalentideas /
Created June 7, 2017 11:57
Bash script for dividing emails.txt into separate .csv files for each 2000 email addresses
line_count=$(cat emails.txt | wc -l)
while [ $file_count -lt $line_count ]
echo "creating file emails_$file_count.csv"
tail -n+$file_count emails.txt | head -n2000 >> emails_$file_count.csv
equivalentideas / command.rb
Created May 24, 2017 01:03
Command to create markdown file of visible comments on a planning application in PlanningAlerts
# Run these commands on the production Rails console
# This creates a markdown file with the comments in the format:
# From: Luke Bacon
# Date of Submission: 6 April 2017
# Comment text bla bla bla
# * * *
equivalentideas / convert_mp3_to_aiff_using_ffmpeg
Created April 14, 2017 07:56
shell command to create new AIFF conversions for all MP3 files in the current directory
find . -name '*.mp3' | sed s/.mp3// | sed 's/.*/&.mp3 &.aiff/' | xargs -n 2 ffmpeg -i
equivalentideas /
Created February 2, 2017 05:28

Keybase proof

I hereby claim:

  • I am equivalentideas on github.
  • I am equivalentideas ( on keybase.
  • I have a public key ASCRtEsTIc-fZIAknASnMfiXEtN623R8LzctenDt90zoTQo

To claim this, I am signing this object:

equivalentideas /
Created November 24, 2016 05:12
This is boilerplate text you can use as the starting point for a request for documents to under the Australian Freedom of Information Act, or equivalent act in a state jurisdiction.

Dear <Organisation with the information>,

Could you please send through <documents with the information you want>.

If possible, please treat this as an administrative/informal request. Otherwise please proceed with my request as a formal information request under the Act.

Yours faithfully,


equivalentideas / extract_hidden_requests_from_right_to_know.rb
Last active August 17, 2017 06:38
Script to run using rails runner to extract information about hidden information requests from Right To Know for analysis. It makes a .csv file with the days date in the title, containing some select (and not safe to publish) information on every hidden request."./tmp/#{}_hidden_requests.csv", "wb") do |csv|
# Make headers
csv << [
equivalentideas / wa_councillors_gender.csv
Created September 16, 2016 05:22
Gender of Western Australian Local Councillors
Council female male
meekatharra shire council 0% 100%
broomehill-tambellup shire council 0% 100%
exmouth shire council 17% 83%
kulin shire council 11% 89%
bassendean town council 17% 83%
leonora shire council 14% 86%
capel shire council 11% 89%
boyup brook shire council 11% 89%
chittering shire council 14% 86%