Capybara 3.13.2 / Ruby 2.5.0 / selenium-webdriver (3.141.0) / chromedriver-helper (2.1.0) / ChromeDriver 2.34.522932
require 'selenium-webdriver'
require 'capybara/dsl'
class C
extend Capybara::DSL
gem 'rails', github: 'rails/rails' | |
require 'active_record' | |
`dropdb bug_1; createdb bug_1` | |
ActiveRecord::Base.establish_connection( | |
adapter: 'postgresql', | |
database: 'bug_1', | |
host: 'localhost', |
class RelativeTime | |
MINUTE = 60 | |
HOUR = 60 * MINUTE | |
DAY = 24 * HOUR | |
WEEK = 7 * DAY | |
MONTH = 4 * WEEK | |
YEAR = 12 * MONTH | |
def self.for(date_to, date_from = Time.zone.now, short: false) | |
diff = (date_from.to_time - date_to.to_time).round |
require 'thread' | |
require 'fiddle' | |
require 'fiddle/import' | |
SM_KCHR_CACHE = 38 | |
SM_CURRENT_SCRIPT = -2 | |
MAX_APP_NAME = 80 | |
module Carbon | |
extend Fiddle::Importer |
From d014d5aea90694868859755f321c41f398bdd55c Mon Sep 17 00:00:00 2001 | |
From: Matt Reynolds <mattreynolds@google.com> | |
Date: Wed, 13 Mar 2019 17:47:00 -0700 | |
Subject: [PATCH] Improve support for Nintendo Switch gamepads | |
This adds support for Nintendo Switch controllers through Gamepad API: | |
* Switch Pro (USB and Bluetooth) | |
* Joy-Con L (Bluetooth) | |
* Joy-Con R (Bluetooth) | |
* Joy-Con L+R (Bluetooth) |
module Discord | |
module Commands | |
extend Discordrb::Commands::CommandContainer | |
def self.handle_errors(e) | |
if e.is_a?(Discordrb::Errors::MessageTooLong) | |
"Message too long" | |
else | |
str = "#{Format.inline(e.message}\n" | |
str += Format.code(e.backtrace.grep(/#{Rails.root.to_s}/).map { |s| s.gsub(Rails.root.to_s, "") }.join("\n")) |
class Format | |
ZERO_WIDTH = "" | |
def self.i(str) | |
"_#{str}_" | |
end | |
def self.b(str) | |
"**#{str}**" | |
end |
set tabstop=2 shiftwidth=2 expandtab | |
set autoindent | |
set smarttab | |
syntax on | |
set shell=/bin/bash | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() |
class Utils | |
def self.compare(reports, n: 10) | |
Benchmark.bm do |x| | |
reports.each do |report| | |
if report.is_a?(Proc) | |
x.report { n.times { report.call } } | |
else | |
x.report(report.first) { n.times { report.last.call } } | |
end | |
end |