When something goes wrong I want to degrade the user experience (instead of returning a 500 - Server Error) And I want to be notified about the failure
Wrap non mission critical code:
| # Strings: | |
| ["Hello", | |
| "Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi! ", | |
| "Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woo |
| #!/usr/bin/env ruby | |
| # Generate a dbdiagram for dbdiagram.io from a dbt project. | |
| # | |
| # Usage: | |
| # 1. Run `dbt docs generate` first. | |
| # 2. Run `dbt_to_dbdiagram.rb` | |
| # 3. Paste the output in https://dbdiagram.io/ | |
| require 'yaml' | |
| require 'json' |
| require_relative './credentials' | |
| class SonosClient | |
| BASE_URL = 'https://api.ws.sonos.com/control/api/v1' | |
| Error = Class.new(StandardError) | |
| def get(path) | |
| r = HTTP.auth("Bearer #{access_token}") | |
| .get(BASE_URL + path) |
| #!/usr/bin/env ruby | |
| # Copy a heroku app (buildpacks, add-ons, labs, config, users). | |
| # This script is idempotent so it can run against an existing app. | |
| # | |
| # Usage: | |
| # $> clone-heroku-app source-app target-app | |
| require 'json' |
| #!/usr/local/env ruby | |
| # | |
| # Generate html traces from CircleCI workflows | |
| # | |
| require 'json' | |
| require 'http' | |
| OWNER = 'githubowner' | |
| REPO = 'githubrepo' |
| #!/usr/bin/env ruby | |
| # | |
| # Run `bundle outdated | format_bundle_outdated` | |
| # to get a CSV file listing the columns below for all outdated gems. | |
| COLUMNS = [ "name", "newest", "installed", "requested", "groups", "delta" ].join(",") | |
| class Version < Struct.new(:major, :minor, :patch, :beta) | |
| def self.build(string) | |
| new(*string.split('.').map(&:to_i)) |
| # no ruby gems required |
| #!/bin/sh | |
| # Extract all new migrations from the current branch over to a new branch (suffixed with "-migration") | |
| set -ev | |
| export branch=`git rev-parse --abbrev-ref HEAD` | |
| git checkout master | |
| git pull | |
| git checkout -b $branch-migration | |
| git checkout $branch -- db engines/*/db |