Skip to content

Instantly share code, notes, and snippets.

View ben-gy's full-sized avatar
🏠
Working from home

Ben Richardson ben-gy

🏠
Working from home
View GitHub Profile
An error occurred while installing pg (0.21.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.21.0' --source 'https://rubygems.org/'` succeeds before bundling.
### Use the command below to fix the error above after having installed postgres.app
sudo ARCHFLAGS="-arch x86_64" gem install pg -v '0.21.0' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/10/bin/pg_config
@ben-gy
ben-gy / Gemfile.rb
Created April 23, 2019 03:06
This is a copy of the gemfile for a social network that I'm building
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.0'
# ++ Back-end infrastructure
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails'
# Use pg as the database for Active Record
@ben-gy
ben-gy / setup.md
Last active April 23, 2019 03:11
How I usually setup a new Rails app

New repo setup

Read the documentation and install each of the following gems after initialising a new rails application. I have provided some initialiser snippets from one of my Rails 5.2 projects with configuration that I'd like to be setup, but please read the documentation to verify the snippets are still constructed correctly based on current gem versions today.

  • install pg (remove sqlite)
  • install paper_trail
  • install act_as_paranoid
  • install rack-attack
class Rack::Attack
@ben-gy
ben-gy / gist:346fa29ab4495c2f49f95196f3942616
Created September 19, 2020 22:53
Latest Gemfile for autoprefixer issue
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.7.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails'
# Use pg as the database for Active Record
gem 'pg'
# Use Puma as the app server
GIT
remote: https://github.com/ben-gy/flexbox_rb.git
revision: 980eaaafda86bb34cd9deeda6b9655f9d101b1cc
specs:
flexbox_rb (0.5)
railties (>= 3.2.6)
GIT
remote: https://github.com/ben-gy/slack-notify.git
revision: 04001abc1676e6e50872d605a84e77342c9c1ec6

API calls

Authentication

Handled with bearer token in the headers: Authorization: Bearer <token> where <token> is the api_key provisioned by Comply Group.

Sample received

POST   /api/v1/received_samples
params = {
  "samples": [