Skip to content

Instantly share code, notes, and snippets.

require 'bundler/inline'
gemfile do
source ''
gem 'graphql', '1.10.10'
class BaseArgument < GraphQL::Schema::Argument
def initialize(*args, **kwargs, &block)
super(*args, prepare: method(:convert_id), **kwargs, &block)
swalkinshaw / application.php
Created November 17, 2019 17:29
Trellis + Sentry
* composer require sentry/sentry-sdk
use Sentry;
// Bedrock application config...
if (env('SENTRY_DSN')) {
'dsn' => env('SENTRY_DSN'),
swalkinshaw /
Last active December 14, 2023 20:53
Secret Santa

Holiday Gift Exchange Problem


A Holiday gift exchange is where a group of people are randomly assigned one other person in the group to buy a gift for. This person can be anyone else in the group except for themselves. Everyone should both give and receive a gift.

Design a program that reads a provided CSV file, performs the matching, and then prints out the matches. Assume that you may email the match to the person later, but focus on printing first.

The format of the CSV is name,email on each row.

const WHITELIST = [
const ALLOW = { cancel: false };
const DENY = { cancel: true };
chrome.webRequest.onBeforeSendHeaders.addListener((req) => {
var cancel = null;
swalkinshaw /
Last active November 13, 2023 08:40
Designing a GraphQL API
swalkinshaw / tracked_hash.rb
Created July 21, 2017 19:22
Ruby hash delegator that tracks which keys were accessed
class TrackedHash < SimpleDelegator
attr_reader :accessed_keys
def initialize(hash)
@accessed_keys =
def [](key)
@accessed_keys << key
swalkinshaw / Capfile
Last active February 28, 2017 19:17
Sage + Capistrano
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Load tasks from gems
require 'capistrano/bower'
require 'capistrano/gulp'
require 'capistrano/npm'
swalkinshaw / update_ember_changelog.rb
Created October 27, 2015 15:54
Ruby script to update the Ember.js file with new releases
require 'bundler/inline'
gemfile(true) do
source ''
gem 'octokit', '~> 4.1.0'
def get_releases
- username: patrick
github: patio11
name: "Patrick McKenzie"
- username: thomas
github: tqbf
name: "Thomas Ptacek"
- username: erin
github: boboTjones
class Model < ActiveRecord::Base
enum status: {
cancelled: 'cancelled',
delayed: 'delayed',
final: 'final',
suspended: 'suspended'