Skip to content

Instantly share code, notes, and snippets.

Scott Walkinshaw swalkinshaw

Block or report user

Report or block swalkinshaw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View application.php
<?php
/**
* composer require sentry/sentry-sdk
*/
use Sentry;
Env::init();
// Bedrock application config...
if (env('SENTRY_DSN')) {
Sentry\init([
'dsn' => env('SENTRY_DSN'),
View group1.csv
Chris,chris@example.com
Felix,felix@example.net
Elizabeth,lizzy1994@example.com
André,andre@example.fr
Milo,milo.milo@example.com
Olivia,olive99@example.net
Hugo,hugo124@example.net
Amit,amit.123@example.com
Ludwig,ludwig@example.net
Raoul,raoul@example.com
View background.js
const WHITELIST = [
'https://cdn.theathletic.com'
]
const ALLOW = { cancel: false };
const DENY = { cancel: true };
chrome.webRequest.onBeforeSendHeaders.addListener((req) => {
var cancel = null;
@swalkinshaw
swalkinshaw / tracked_hash.rb
Created Jul 21, 2017
Ruby hash delegator that tracks which keys were accessed
View tracked_hash.rb
class TrackedHash < SimpleDelegator
attr_reader :accessed_keys
def initialize(hash)
super
@accessed_keys = Set.new
end
def [](key)
@accessed_keys << key
@swalkinshaw
swalkinshaw / Capfile
Last active Feb 28, 2017
Sage + Capistrano
View Capfile
# 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
swalkinshaw / update_ember_changelog.rb
Created Oct 27, 2015
Ruby script to update the Ember.js CHANGELOG.md file with new releases
View update_ember_changelog.rb
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'octokit', '~> 4.1.0'
end
CHANGELOG_PATH = 'CHANGELOG.md'
def get_releases
View ansible-snippet.yaml
vars:
starfighters:
- username: patrick
github: patio11
name: "Patrick McKenzie"
- username: thomas
github: tqbf
name: "Thomas Ptacek"
- username: erin
github: boboTjones
View model.rb
class Model < ActiveRecord::Base
enum status: {
cancelled: 'cancelled',
delayed: 'delayed',
final: 'final',
suspended: 'suspended'
}
end
View deploy.rb
set :application, 'my_app_name'
set :repo_url, 'git@example.com:me/my_repo.git'
set :branch, :master
set :deploy_to, -> { "/srv/www/#{fetch(:application)}" }
set :log_level, :info
set :linked_files, fetch(:linked_files, []).push('.env')
set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads')
namespace :deploy do
desc 'Restart application'
You can’t perform that action at this time.