This file contains hidden or 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 'net/protocol' | |
| class Net::Protocol | |
| module ForceSNI | |
| def ssl_socket_connect(*) | |
| @sock.hostname = @host if @sock.respond_to? :hostname= | |
| super | |
| end | |
| end | |
| prepend ForceSNI |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # This script is for rbenv to configure ruby like Ports does. | |
| # (amd64 instead of x86_64) | |
| # | |
| # RUBY_CONFIGURE=ruby-configure | |
| # | |
| rsync -av /usr/ports/Templates/config.* tools/ | |
| exec ./configure "$@" |
This file contains hidden or 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
| module Foo | |
| refine Hash do | |
| def each_smtn(&block) | |
| return to_enum(__method__) unless block | |
| block.call(1) | |
| block.call(2) | |
| end | |
| end | |
| end |
This file contains hidden or 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
| # -*- mode: snippet -*- | |
| # name: block-with-var | |
| # -- | |
| { |${1:var}| ${1:$(if (string-match "\\\\_<[a-z]\\\\sw*" yas-text) (match-string 0 yas-text))}.$0 } |
This file contains hidden or 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
| ' ー | |
| , 、 | |
| - ー | |
| . 。 | |
| / ・ | |
| ; っ | |
| [ 「 | |
| ] 」 | |
| a あ | |
| b' びー |
This file contains hidden or 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
| return unless Rails.env.test? | |
| require 'highline' | |
| require "action_dispatch/system_testing/test_helpers/screenshot_helper" | |
| module ActionDispatch | |
| module SystemTesting | |
| module TestHelpers | |
| module ScreenshotHelper | |
| module HtmlSaver |
This file contains hidden or 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
| FROM gcr.io/google-appengine/ruby:latest | |
| ARG REQUESTED_RUBY_VERSION="2.5.1" | |
| RUN if test -n "$REQUESTED_RUBY_VERSION" -a \ | |
| ! -x /rbenv/versions/$REQUESTED_RUBY_VERSION/bin/ruby; then \ | |
| (apt-get update -y \ | |
| && apt-get install -y -q gcp-ruby-$REQUESTED_RUBY_VERSION) \ | |
| || (cd /rbenv/plugins/ruby-build \ | |
| && git pull \ |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # | |
| # git-merge-structure-sql - git merge driver for db/structure.sql of Rails projects | |
| # | |
| # How to use: | |
| # $ git config merge.merge-structure-sql.name 'Rails structure.sql merge driver' | |
| # $ git config merge.merge-structure-sql.driver 'git-merge-structure-sql %A %O %B' | |
| # | |
| # # To enable it locally: | |
| # $ echo 'structure.sql merge=merge-structure-sql' >> .git/info/attributes |
This file contains hidden or 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
| (defadvice rspec-spec-file-for (around request-spec-support (a-file-name) activate) | |
| (let ((file ad-do-it)) | |
| (setq ad-return-value | |
| (cond ((file-exists-p file) | |
| file) | |
| ((string-match "\\`\\(.*/spec/\\)controllers\\(/.+\\)_controller\\(_spec\\.rb\\)\\'" file) | |
| (concat (match-string 1 file) | |
| "requests" | |
| (match-string 2 file) | |
| (match-string 3 file))) |