Skip to content

Instantly share code, notes, and snippets.

View thomasgallagher's full-sized avatar

Tom Gallagher thomasgallagher

View GitHub Profile
@thomasgallagher
thomasgallagher / gist:42df30f65e1ae6f91534
Created December 7, 2015 07:42
Ruby 2.2.3 and Rails 4.2.5 basic gem file (no comments, alphabetical)
source 'https://rubygems.org'
ruby '2.2.3'
gem 'rails', '4.2.5'
gem 'pg', '~> 0.15'
gem 'coffee-rails', '~> 4.1.0'
gem 'jbuilder', '~> 2.0'
gem 'jquery-rails'
gem 'sass-rails', '~> 5.0'
@thomasgallagher
thomasgallagher / 20160506131246_add_tsvector_to_users
Created May 7, 2016 07:53
pg_search partial weighted matching over first_name, last_name, location on User
class AddTsvectorToUsers < ActiveRecord::Migration
def up
add_column :users, :tsv, :tsvector
add_index :users, :tsv, using: 'gin'
execute <<-SQL
CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE
ON users FOR EACH ROW EXECUTE PROCEDURE
tsvector_update_trigger(
tsv, 'pg_catalog.simple', first_name, last_name, location
@thomasgallagher
thomasgallagher / readme.md
Last active February 6, 2023 10:24
Install ImageMagick 7.1.0-61 to patch CVE-2022-44268 zero day vulnerability on Heroku

1. Add this updated buildpack to install ImageMagick 7.1.0-61

heroku buildpacks:add https://github.com/thomasgallagher/heroku-buildpack-imagemagick --index 1

You can also add this via Settings > Buildpacks on the Heroku dashboard

Optional: Fork this repo and replace the above URL to make it your own:

https://github.com/thomasgallagher/heroku-buildpack-imagemagick

2. Deploy your app