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 / 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
@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 January 13, 2018 21:02
Pre-compile Assets and Cache for CircleCI
- restore_cache:
keys:
- v1-asset-cache-{{ arch }}-{{ .Branch }}
- v1-asset-cache-
- run: bundle exec rake assets:precompile
- save_cache:
key: v1-asset-cache-{{ arch }}-{{ .Branch }}-{{ epoch }}
paths:
@pftg
pftg / .circleci-config.yml
Created December 1, 2017 02:09
Typical pronto setup for Ruby on Rails + GitHub + CircleCI 2.0
# .circleci/config.yml
version: 2
jobs:
lint:
environment:
- BUNDLE_GEMFILE: Gemfile.tools
docker:
# specify the version you desire here
- image: circleci/ruby:2.4.2-stretch-node-browsers
environment:
@pftg
pftg / m4a-to-mpr.md
Last active April 24, 2020 08:07
Compress m4a with audio notes
ffmpeg -i tmp/audio-notes.m4a -acodec libmp3lame -aq 9 tmp/audio-notes.mp3
for file in *.m4a ; do ffmpeg -i $file -acodec libmp3lame -aq 9 ${file%.m4a}.mp3 ; done
@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
@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 / .circleci_config.yml
Created January 13, 2018 21:03
Pre-compile Assets and Cache for CircleCI
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
jobs:
build:
environment:
BUNDLE_GEMFILE: Gemfile
BUNDLE_WITHOUT: "production:staging:development"