This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScaffoldGenerator < Rails::Generators::NamedBase | |
source_root File.expand_path("templates", __dir__) | |
# Run rails:scaffold with the same arguments and options | |
hook_for :scaffold, in: :rails, default: true, type: :boolean | |
def turbo_refreshes | |
# Scaffold generator will have already removed this file on revoke | |
return if behavior == :revoke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Request | |
attr_reader :exception, :response | |
def initialize(context = {}) | |
@context = context | |
end | |
def execute | |
@response ||= Response.call(execute_request) | |
self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
ui = true | |
[user] | |
name = Chris Oliver | |
email = [email protected] | |
signingkey = 0E881BAF04745832 | |
[color "diff-highlight"] | |
oldNormal = red bold | |
oldHighlight = red bold 52 | |
newNormal = green bold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
class LocaleGroup | |
attr_reader :output | |
def initialize | |
@output = {} | |
@output.default_proc = -> (h, k) { h[k] = Hash.new(&h.default_proc) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- app/views/attachments/_attachment.html.erb --> | |
<div class="attachment-image col-xs-6 col-sm-4 col-md-3" id="attachment_<%= @report.slug %><%= attachment.id %>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> | |
</div> | |
<div class="attachment-options-wrapper"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
require 'cgi' | |
require 'uri' | |
begin | |
uri = URI.parse(ENV["DATABASE_URL"]) | |
rescue URI::InvalidURIError | |
raise "Invalid DATABASE_URL" | |
end | |
raise "No RACK_ENV or RAILS_ENV found" unless ENV["RAILS_ENV"] || ENV["RACK_ENV"] | |
def attribute(name, value, force_string = false) |
NewerOlder