Skip to content

Instantly share code, notes, and snippets.


Chris Oliver excid3

View GitHub Profile
View request.rb
class Request
attr_reader :exception, :response
def initialize(context = {})
@context = context
def execute
@response ||=
View git config global
ui = true
name = Chris Oliver
email =
signingkey = 0E881BAF04745832
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
View vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
View authenciates_with_two_factor.rb
# frozen_string_literal: true
# == AuthenticatesWithTwoFactor
# Controller concern to handle two-factor authentication
module AuthenticatesWithTwoFactor
extend ActiveSupport::Concern
def prompt_for_two_factor(user)
@user = user
View applocales.rb
require 'yaml'
class LocaleGroup
attr_reader :output
def initialize
@output = {}
@output.default_proc = -> (h, k) { h[k] = }
excid3 / index.rb
Created Dec 13, 2019
Rubocop Linter Action
View index.rb
# frozen_string_literal: true
require 'json'
require 'net/http'
require 'time'
require 'yaml'
require_relative './report_adapter'
require_relative './github_check_run_service'
require_relative './github_client'
require_relative './install'
View user.rb
class User
def github_student_url
# The School ID GitHub gave you
school_id = "your-school-id"
# The secret key GitHub gave you
secret_key = "secret-key"
# The ID of the student in your database
student_id = id.to_s
excid3 / _attachment.html.erb
Last active May 7, 2019 — forked from aymorgan/_attachment.html.erb
JQuery File Upload, Amazon S3 and Shrine - rendering with a partial
View _attachment.html.erb
<!-- app/views/attachments/_attachment.html.erb -->
<div class="attachment-image col-xs-6 col-sm-4 col-md-3" id="attachment_<%= @report.slug %><%= %>elv1">
<div class="row">
<div class="attached-image-wrapper col-xs-12">
<a class="attached-image" data-lightbox="report-attachment" style="background-image:url('<%= attachment.image_url(:preview) %>');" href="<%= attachment.image_url(:original) %>"></a>
<div class="attachment-options-wrapper">
View database.yml
require 'cgi'
require 'uri'
uri = URI.parse(ENV["DATABASE_URL"])
rescue URI::InvalidURIError
raise "Invalid DATABASE_URL"
raise "No RACK_ENV or RAILS_ENV found" unless ENV["RAILS_ENV"] || ENV["RACK_ENV"]
def attribute(name, value, force_string = false)
# Logfile created on 2019-02-06 14:39:16 -0800 by logger.rb/66358
INFO ---------------------------------------------------------------------------
INFO START 2019-02-06 14:39:16 -0800 cap production deploy
INFO ---------------------------------------------------------------------------
DEBUG [a31dcb3c] Running [ -d $HOME/.rbenv/versions/2.5.3 ] as deploy@
DEBUG [a31dcb3c] Command: [ -d $HOME/.rbenv/versions/2.5.3 ]
DEBUG [7cf4009d] Finished in 9.738 seconds with exit status 0 (successful).
INFO [1bc30033] Running /usr/bin/env mkdir -p /tmp as deploy@
DEBUG [1bc30033] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.3" ; /usr/bin/env mkdir -p /tmp )
INFO [815d8d82] Finished in 0.099 seconds with exit status 0 (successful).