Skip to content

Instantly share code, notes, and snippets.

Avatar
👒
He/Him/His

Luke Bacon equivalentideas

👒
He/Him/His
View GitHub Profile
@equivalentideas
equivalentideas / 2018-02-05_working_with_spreadsheets_outline.md
Created February 7, 2018 08:32
Outline for Working with spreadsheets, Free Class at Frontyard Projects
View 2018-02-05_working_with_spreadsheets_outline.md
@equivalentideas
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
View slack_reactions_from_export.rb
# 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
equivalentideas / Rebooting morph.io production Linode server.md
Last active October 2, 2017 10:28
Runsheet for rebooting the current production morph.io server
View Rebooting morph.io production Linode server.md

Rebooting the production morph.io server

  1. Log into Linode and go to the page for morph.io
  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 root@morph.io
  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
equivalentideas / email_divider.sh
Created June 7, 2017 11:57
Bash script for dividing emails.txt into separate .csv files for each 2000 email addresses
View email_divider.sh
line_count=$(cat emails.txt | wc -l)
file_count=0
while [ $file_count -lt $line_count ]
do
echo "creating file emails_$file_count.csv"
tail -n+$file_count emails.txt | head -n2000 >> emails_$file_count.csv
file_count=$[$file_count+2000]
done
@equivalentideas
equivalentideas / command.rb
Created May 24, 2017 01:03
Command to create markdown file of visible comments on a planning application in PlanningAlerts
View command.rb
# 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
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
View convert_mp3_to_aiff_using_ffmpeg
find . -name '*.mp3' | sed s/.mp3// | sed 's/.*/&.mp3 &.aiff/' | xargs -n 2 ffmpeg -i
@equivalentideas
equivalentideas / keybase.md
Created February 2, 2017 05:28
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am equivalentideas on github.
  • I am equivalentideas (https://keybase.io/equivalentideas) on keybase.
  • I have a public key ASCRtEsTIc-fZIAknASnMfiXEtN623R8LzctenDt90zoTQo

To claim this, I am signing this object:

@equivalentideas
equivalentideas / freedom_of_information_request_boilerplate.md
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.
View freedom_of_information_request_boilerplate.md

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
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.
View extract_hidden_requests_from_right_to_know.rb
CSV.open("./tmp/#{Date.today.to_s}_hidden_requests.csv", "wb") do |csv|
# Make headers
csv << [
"id",
"title",
"url",
"public_body_name",
"jurisdiction",
"created_at",
"requester_name",
@equivalentideas
equivalentideas / wa_councillors_gender.csv
Created September 16, 2016 05:22
Gender of Western Australian Local Councillors
View wa_councillors_gender.csv
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%