Skip to content

Instantly share code, notes, and snippets.

View pat's full-sized avatar
🇵🇸
free Palestine 🇵🇸

Pat Allan pat

🇵🇸
free Palestine 🇵🇸
View GitHub Profile
function ruby_files() {
xargs ls -1 2>/dev/null | grep '\.rb$'
}
function spec_files() {
xargs ls -1 2>/dev/null | grep '_spec\.rb$'
}
function uncommitted() {
# first command is staged changes, second is new files and unstaged changes
@pat
pat / .rubocop.yml
Last active April 21, 2021 09:38
Shared Personal Rubocop configuration.
AllCops:
TargetRubyVersion: 2.5
Exclude:
- 'db/schema.rb'
- 'vendor/**/*'
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Layout/DotPosition:
@pat
pat / README.markdown
Last active April 16, 2021 00:55
Custom CSS for Safari (likely every browser) to avoid the who-to-follow and trends components.

EDIT These rules do not work with the current desktop-browser design for Twitter (mid-2019). Try uBlock Origin with these rules instead.

But if you're somehow using an old Twitter design…

In Safari's preferences, the ability to choose a custom CSS file is under the Advanced tab. As far as I can tell, you must quit and re-open Safari when you make changes to the file to see those changes take place on the sites you're browsing.

Sphinx Statistics

I’ve been working on a Thinking Sphinx add-on for Heroku. It’s not launched yet, and I’m ironing out the possible plans I’ll offer. One key piece of information I’d love to have is a rough rule of how much RAM a searchd process uses in relation to how big the index files are.

If you’re using Sphinx on an app, and are willing to share this information, it’d be wonderful if you could get in touch with me, via email (pat at freelancing-gods dot com), or via twitter.

I’m after real (ie: production) data – development environment stats aren’t quite so useful :)

Here’s how I check the stats on my own sites:

@pat
pat / letter.markdown
Created October 21, 2019 03:15
Letter to Senator Lambie about Medevac Repeal Bill

Dear Senator Lambie,

I am writing in regards to the Medevac Repeal Bill, and to strongly urge you to not allow the repeal to happen.

It is our Government that has imprisoned these people in these remote and unsafe situations, and thus it is our Government that should be providing medical support, especially given the imprisonment is a significant cause in the mental health issues so many of these detainees.

While I’m sure you’re aware of this already, it’s worth noting that the legislation that was passed earlier this year is only for the current set of detainees - it does not apply to any new arrivals, and I feel our Government has been rather obtuse in any suggestions otherwise. Any suggestion that the lack of a repeal makes our country any less safe is a cruel lie.

There have been clear cases of deaths in custody that could have been prevented had proper medical assistance been provided promptly and genuinely, rather than turning these detainees into political pawns. If the repeal goes ahead, it’s quit

require "openssl"
require "digest/sha2"
require "base64"
require "ostruct"
# Just like Aws::KMS::Client, this responds to decrypt and encrypt,
# using the same parameters and output objects (well, at least for
# the purposes of what I've used it for).
#
# So, you can inject this class in instead for test environments
@pat
pat / parallel_processor.rb
Last active August 21, 2019 12:28
Thinking Sphinx parallel processing of real-time indices.
# This will process each real-time index in parallel (using separate
# processes, up to the number of CPUs available).
#
# You will also need the 'parallel' gem, and what is currently the
# edge release of Thinking Sphinx (until there's been a release after
# v4.3.2).
#
# This could all go in an initialiser, or put the class wherever you
# like, and the assignment in the initialiser.
@pat
pat / minutes.markdown
Last active May 21, 2019 12:31
Ruby Australia Special General Meeting - 12th May 2019

Attendees

  • Pat Allan
  • Mark Glossop
  • Rebecca Le
  • Celia Colquhoun King
  • Steven Webb
  • Nimeshe Madanayake
  • Vanessa Nimmo
  • Lauren Hennessy

To Whom It May Concern

RE: Telecommunication and Other Legislation Amendment (Assistance and Access) Act 2018

Ruby Australia is an industry body representing software developers who use the Ruby programming language across a range of businesses, industries, products and projects, and across Australia.

On behalf of our members generally (and specifically those who have supplied their signatures) we strongly condemn the Telecommunications and Other Legislation Amendment (Assistance and Access) Act 2018, which has recently passed both houses of Parliament.

The Act was hurried through without any serious consideration for industry concerns, and has a worrying lack of oversight. It shows a severe lack of technological understanding, no respect for citizens' privacy, nor any serious appreciation for digital security. And through its existence, it tars our entire profession. Because of what our Government may insist of us, our international peers and customers can no longer trust us or our products with their ow

@pat
pat / rubyconf-au-eoi-2020.markdown
Created January 20, 2019 22:44
RubyConf AU 2020 - Seeking Expressions of Interest

Ruby Australia

Seeking expressions of interest for RubyConf AU 2020

Expressions Required By: February 18th 2019.

One of the flagship events of the Australian Ruby community's calendar is RubyConf AU, which has been occurring annually since 2013. The Ruby Australia committee is seeking expressions of interest from people in the community to run the 2020 edition of the conference.

To support conference organisers, Ruby Australia offers event insurance and financial backing courtesy of previous events and sponsors. Also, previous organisers will be able to provide wisdom and suggestions from their past experiences, previous budgets, connections to vendors, suggested speakers to invite, and other general advice.