Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jerridan's full-sized avatar

Jerridan Quiring jerridan

  • Toronto, ON, Canada
View GitHub Profile
@jerridan
jerridan / apollo_provider_setup_new.js
Last active April 20, 2024 04:31
Implementing GraphQL Subscriptions in Rails and React
// ...
import ActionCable from "@rails/actioncable";
import ActionCableLink from "graphql-ruby-client/subscriptions/ActionCableLink";
import { split } from "@apollo/client";
import { getMainDefinition } from "@apollo/client/utilities";
// Setup a link for action cable
const cable = ActionCable.createConsumer(<YOUR_ACTION_CABLE_ENDPOINT>);
const actionCableLink = new ActionCableLink({ cable });
@jerridan
jerridan / install_phpunit.sh
Created August 1, 2014 21:40
Install PHPUnit on a vagrant machine
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "$(tput setaf 1)This script must be run as root$(tput sgr 0)" 1>&2
exit 1
fi
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/bin/phpunit
@jerridan
jerridan / permission_finder.rb
Last active October 23, 2017 21:04
Helper to find (most) AWS permissions for Terraform
#!/usr/bin/ruby
# frozen_string_literal: true
# Instructions:
# Set TF_LOG=debug and run `terraform apply > apply_log.txt`, followed by `terraform destroy > destroy_log.txt`
# Run this script (permission_finder.rb) with those log files => `permission_finder.rb apply_log.txt destroy_log.txt`
# This script will parse through the requests that Terraform made to AWS. Note that it is NOT perfect.
# There are some 'gotchas' I've seen that are noted below in the TODO section.

Keybase proof

I hereby claim:

  • I am jerridan on github.
  • I am jerridan (https://keybase.io/jerridan) on keybase.
  • I have a public key ASAKMFL6LttF_k4Xs3MJWcoh51JCFnF_YQSbXvJWFwPe5go

To claim this, I am signing this object: