Skip to content

Instantly share code, notes, and snippets.

View pftg's full-sized avatar
💭
I may be slow to respond.

Paul Keen pftg

💭
I may be slow to respond.
View GitHub Profile
# docker run --rm -it -v $PWD:/app -w /app durosoft/crystal-alpine:latest crystal run basic_experiment.cr
require "./test_data"
require "http/client"
require "time"
started_at = Time.monotonic
WORKER_COUNT = 2000
@pftg
pftg / highload.md
Created October 12, 2022 18:17 — forked from pavlov200912/highload.md
Конспект Проектирование Высоконагруженных систем 2021

package main

/* Билеты по Проектированию Высоко нагруженных систем

  • В этом конспекте нет автоматической грамматической проверки
  • Он написан для личного пользования, исключительно для подготовки к экзамену
@pftg
pftg / chrome-args-for-e2e.rb
Last active April 17, 2022 10:53
Tuning Chrome Options for better e2e tests
CHROME_ARGS = {
"allow-running-insecure-content" => nil,
"autoplay-policy" => "user-gesture-required",
"disable-add-to-shelf" => nil,
"disable-background-networking" => nil,
"disable-background-timer-throttling" => nil,
"disable-backgrounding-occluded-windows" => nil,
"disable-breakpad" => nil,
"disable-checker-imaging" => nil,
"disable-client-side-phishing-detection" => nil,
@pftg
pftg / .circleci_config.yml
Created March 6, 2020 07:24
CirclecCI config to support React Native development. Run tests and verify builds of androdi
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
# https://circleci.com/docs/2.0/configuration-reference
version: 2
jobs:
android:
working_directory: ~/project/android
docker:
- image: circleci/android:api-29-node
@pftg
pftg / Yarn Upgrade Indirect Dependencies.md
Last active March 9, 2023 19:56
Update indirect dependencies in yarn.lock. `ruby rejuvenation.rb & yarn install`
$> curl "https://gist.githubusercontent.com/pftg/fa8fe4ca2bb4638fbd19324376487f42/raw/f9056244c416d2f56d6d94290e5ecef5960abf66/rejuvenation.rb" | ruby

or

$> ruby rejuvenation.rb
$> yarn install
#!/bin/bash
set -e
set -o pipefail
# Kill all backgorund process started in this script
#trap "kill 0" EXIT
#trap "exit" INT TERM ERR
# run background process
# wait
@pftg
pftg / virtual-attributes_example_test.rb
Last active March 1, 2019 15:05
Example of virtual attributes cases
# frozen_string_literal: true
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@pftg
pftg / examples_of_implementations.rb
Created February 16, 2019 18:59
Non-blocking io examples
require 'async/http/faraday'
require 'async/http/response'
require 'async/http/server'
require 'async/http/url_endpoint'
require 'async/reactor'
require 'uri/http'
# Make it the global default:
Faraday.default_adapter = :async_http
@pftg
pftg / install_serviceoworker.patch
Created November 18, 2018 18:44
Install serviceworker-rails for Rails 5 + Webpacker
diff --git a/Gemfile b/Gemfile
index 4983412..454bd32 100644
--- a/Gemfile
+++ b/Gemfile
@@ -11,6 +11,10 @@ gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 3.11'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '>= 4.0.x'
+
+# Turn your Rails app into a Progressive Web App. https://github.com/rossta/serviceworker-rails
release: bin/heroku-release
web: bundle exec puma -C config/puma.rb