Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Keen pftg

View GitHub Profile
@pftg
pftg / .circleci_config.yml
Created Mar 6, 2020
CirclecCI config to support React Native development. Run tests and verify builds of androdi
View .circleci_config.yml
# 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 Feb 4, 2021
Update indirect dependencies in yarn.lock. `ruby rejuvenation.rb & yarn install`
View Yarn Upgrade Indirect Dependencies.md
$> curl "https://gist.githubusercontent.com/pftg/fa8fe4ca2bb4638fbd19324376487f42/raw/f9056244c416d2f56d6d94290e5ecef5960abf66/rejuvenation.rb" | ruby

or

$> ruby rejuvenation.rb
$> yarn install
View vue-rails.sh
#!/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 Mar 1, 2019
Example of virtual attributes cases
View virtual-attributes_example_test.rb
# 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.
View examples_of_implementations.rb
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 Nov 18, 2018
Install serviceworker-rails for Rails 5 + Webpacker
View install_serviceoworker.patch
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
View Procfile
release: bin/heroku-release
web: bundle exec puma -C config/puma.rb
@pftg
pftg / Procfile
Created Jul 18, 2018
Heroku Review Setup for Ruby on Rails 5
View Procfile
release: bin/heroku-release
web: bundle exec puma -C config/puma.rb
@pftg
pftg / config_environments_test.rb
Last active Jan 13, 2018
Involved browser caching for test in Rails 4 application
View config_environments_test.rb
Rails.application.configure do
# ...
# For Rails 4 we need to add those settings
config.serve_static_files = true
config.static_cache_control = 'public, max-age=2592000'
config.assets.digest = true
config.assets.debug = false
if ENV['CI']
config.assets.compile = false
@pftg
pftg / .circleci_config.yml
Created Jan 13, 2018
Pre-compile Assets and Cache for CircleCI
View .circleci_config.yml
# 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"