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| 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 |
| 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 Format | |
| ZERO_WIDTH = "" | |
| def self.i(str) | |
| "_#{str}_" | |
| end | |
| def self.b(str) | |
| "**#{str}**" | |
| end |
| 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")) |
| 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) |
| require 'thread' | |
| require 'fiddle' | |
| require 'fiddle/import' | |
| SM_KCHR_CACHE = 38 | |
| SM_CURRENT_SCRIPT = -2 | |
| MAX_APP_NAME = 80 | |
| module Carbon | |
| extend Fiddle::Importer |
Made a working one with only ruby and git as a dependency:
One liner to type in irb:
def format(file); split = file.split('/'); return file unless split.size > 1; "│ " * (split.size - 2) + "└── " + split.last; end; def list(dir, start: true); puts dir if start; `git ls-tree master "#{dir}" --name-only`.split("\n").sort.each { |line| split = line.split('/'); puts format(line); list(line + '/', start: false) if File.directory?(line) }; end; list('.')
And as a more proper script: