Skip to content

Instantly share code, notes, and snippets.

set -eux
wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip"
unzip BrowserStackLocal-linux-x64.zip
./BrowserStackLocal $ACCESS_KEY &
bundle exec cucumber
app@e0d06d8801e4:/app/actionpack$ ruby -e "puts 100.times.select { system('bin/test test/controller/render_test.rb') }.count"
Run options: --seed 10537
# Running:
.................................................................
Finished in 1.416651s, 45.8829 runs/s, 222.3554 assertions/s.
65 runs, 315 assertions, 0 failures, 0 errors, 0 skips
Run options: --seed 27092
@mtsmfm
mtsmfm / test.yml
Last active May 17, 2019 11:15
CircleCI hangs
version: 2.1
workflows:
version: 2
test:
jobs:
- test
jobs:
test:
docker:
@mtsmfm
mtsmfm / test.html
Last active January 30, 2019 12:19
iOS title bug
<html>
<head>
<script>
document.title = 'aaaaa';
setTimeout(() => {
history.pushState({}, "", "/xxxxxxxxxx");
}, 3000);
</script>
</body>
Test
class YAMLTreeBuilder < YAML::TreeBuilder
def initialize
super
@path_stack = []
end
def scalar(*)
super.tap do
if YAML::Nodes::Mapping === @last
@mtsmfm
mtsmfm / config.ru
Created September 12, 2018 08:56
Minimal active storage example
# 1. Put this file into the root of rails repo
# 2. `bundle exec rackup -b 0.0.0.0`
# 3. `open localhost:9292`
require 'rails/all'
tmpdir = Dir.mktmpdir
Dir.chdir(tmpdir)
ENV['DATABASE_URL'] = "sqlite3://#{File.join(tmpdir, 'database.sql')}"
@mtsmfm
mtsmfm / README.md
Last active April 14, 2018 09:54
Docker for Mac + k8s dashboard + helm
@mtsmfm
mtsmfm / Dockerfile
Last active December 7, 2017 16:31
Hanging poltegeist
FROM ruby:2.4.2
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get update && apt-get install less nodejs -y
RUN npm install -g phantomjs-prebuilt
RUN gem install poltergeist
WORKDIR /app
COPY . .
ENTRYPOINT ruby test.rb
@mtsmfm
mtsmfm / README.md
Last active November 21, 2017 18:10
wget https://gist.githubusercontent.com/mtsmfm/cb1db1389eeede827936c069bdd85fda/raw/9af1965716fc1635800002fb9b715b9aef98376c/initialize_example
cat initialize_example | bundle exec language_server-ruby
class X < BasicObject
MAP = {
fizz: 3,
buzz: 5
}
def initialize(n)
@n = n
@result = nil
end