Skip to content

Instantly share code, notes, and snippets.

View sauy7's full-sized avatar

Tim Heighes sauy7

  • Stockholm, Sweden
View GitHub Profile
@sauy7
sauy7 / namespace.rb
Created April 7, 2021 20:59
Splitting GraphQL Queries in Rails
# app/graphql/queries/namespace.rb
module Queries
module Namespace
extend ActiveSupport::Concern
included do
field :thing #, ...
end
def thing
​# Git​
.git
.gitignore
​# Logs​
log/*
# Temp files​
tmp/*
@sauy7
sauy7 / Gemfile
Created May 5, 2016 13:59
Adding support for creating GitHub issues with Exception Notification gem in Rails
gem 'octokit', ~> '4.3.0'
@sauy7
sauy7 / contract.rb
Created November 8, 2015 15:15
Trailblazer: Uninitialized constant Thing::Update (contract.rb:5)
class Thing::Create::Contract < Reform::Form
...
end
class Thing::Update::Contract < Thing::Create::Contract
...
end
@sauy7
sauy7 / cell.rb
Created June 3, 2015 06:09
Example using Devise's current_user with Trailblazer and Cells 4.0.0.beta5
# concepts/account/cell.rb
class Account::Cell < Cell:Concept
...
def show
render
end
class Grid < Cell::Concept
def show
@sauy7
sauy7 / commands
Created January 25, 2013 15:20
Example launchd plist file and shell script etc. for debugging the environment when running scripts as a user.
# How to get running and monitor
chmod 777 /Users/username/bin/debug.sh
launchd unload -w /Library/LaunchDaemons/debug.plist
launchd load -w /Library/LaunchDaemons/debug.plist
tail -f /Users/username/tmp/debug.stderr.log
tail -f /Users/username/tmp/debug.stdout.log