Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Epigene's full-sized avatar

Augusts Bautra Epigene

View GitHub Profile
@Epigene
Epigene / 50.json
Created January 10, 2020 13:14
Flamegraph for method spec on Rails 5.0
{"version":1.2,"mode":"wall","interval":1000,"samples":817,"gc_samples":220,"missed_samples":189,"metadata":{},"frames":{"2256502940":{"name":"Mysql2::Client#query","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/mysql2-0.5.3/lib/mysql2/client.rb","line":129,"total_samples":17,"samples":17,"edges":{"2256502940":17},"lines":{"131":[16,16],"130":[17,0],"132":[1,1]}},"2279488660":{"name":"ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter#execute","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_mysql_adapter.rb","line":217,"total_samples":27,"samples":0,"edges":{"2256502940":17,"2228340160":27},"lines":{"218":[44,0]}},"2228340160":{"name":"ActiveRecord::ConnectionAdapters::AbstractAdapter#log","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb","line":582,"total_samples":27,"samples":0,"edges":{"2279488660":17,"2230307860":27},"lines":{"590":[17,0],"583":[27,0]}},
@Epigene
Epigene / 42.json
Created January 10, 2020 13:14
Flamegraph for method spec on Rails 4.2
{"version":1.2,"mode":"wall","interval":1000,"samples":251,"gc_samples":151,"missed_samples":24,"frames":{"2248648540":{"name":"Mysql2::Client#query","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/mysql2-0.4.10/lib/mysql2/client.rb","line":118,"total_samples":5,"samples":5,"edges":{"2248648540":5},"lines":{"120":[5,5],"119":[5,0]}},"2319186460":{"name":"ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter#execute","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb","line":316,"total_samples":8,"samples":0,"edges":{"2248648540":5,"2245218080":8},"lines":{"317":[13,0]}},"2245218080":{"name":"ActiveRecord::ConnectionAdapters::AbstractAdapter#log","file":"/Users/augusts/.rvm/gems/ruby-2.5.3/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract_adapter.rb","line":477,"total_samples":8,"samples":0,"edges":{"2319186460":5,"2242197020":8},"lines":{"484":[5,0],"478":[8,0]}},"2242197020":{"name":"ActiveSupport::N
@Epigene
Epigene / bundler.config
Last active December 24, 2019 11:19
Make bundler always use some pg_config
# single install
gem install pg -v 1.1.4 -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/12/bin/pg_config
# permanent config, troublesome
bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.6/bin/pg_config
@Epigene
Epigene / settings.json
Created December 10, 2019 08:08
Gene's VSC general settings, 2019-12-10
{
"terminal.integrated.env.osx": {
"PATH": "~/.rvm/gems/ruby-2.5.3/bin:~/.rvm/rubies/ruby-2.5.3/bin:~/.rvm/bin:/bin:/usr/local/opt/qt@5.5/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
},
"ctags": {
"executePath": "~/.rvm/gems/ruby-2.5.3/gems/ripper-tags-0.7.0/bin/ripper-tags",
"options": "--tag-file=.tags --recursive --force --exclude=/assets/ --exclude=.bundle --exclude=.git/ --exclude=coverage/ --exclude=log/ --exclude=tmp/ --exclude=bin/",
"fileName": ".tags"
},
"colorInfo.languages": [
@Epigene
Epigene / ruby.json
Last active December 10, 2019 08:06
Gene's snippets for VSC, 2019-12-10
{
"service_spec template": {
"prefix": "service_spec",
"body": [
"RSpec.describe $0TODO, :service do",
" let(:options) do",
" {}",
" end",
"",
" describe \"#call\", :implicit_subject do",
@Epigene
Epigene / LatvianHashPlus.keylayout
Last active October 26, 2019 10:35
Latvian key layout with Shift+3 producing # symbol.
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Created by Ukelele version 2.2.8 on 2014-09-16 at 09:30 (GMT+3)-->
<!--Last edited by Ukelele version 3.0.0.43 on 2015-11-15 at 20:41 (EET)-->
<keyboard group="0" id="13634" maxout="1" name="LatvianHashPlus">
<layouts>
<layout first="0" last="0" mapSet="138" modifiers="30"/>
</layouts>
<modifierMap defaultIndex="8" id="30">
<keyMapSelect mapIndex="0">

Karabiner Elements v12.7.0 custom rule setup

  1. Open ~/.config/karabiner/assets/complex_modifications
  2. Make a new *.json rule file
  3. Put the rule json in there.
  4. Reload Karabiner and add the rule.

Control + D to Show Desktop

@Epigene
Epigene / deploy.rb
Last active June 14, 2019 06:01
Mina deployment file for rails applications
# Mina Deploy
# ===========
#
# Adapted from Creative deploy stack in Manabalss v4, Mar.2015, updated to support staging on Jun.2015
# On first deploy do: mina setup --verbose
# Then do : mina deploy[initialize] --trace
#
# Usage examples:
# mina deploy[soft,seed,compile] to=staging # deploy task with all options | a simple `mina deploy` will deploy to production
# mina rake[db:seed] # for multi-argument tasks # mina 'rake[payments:refund[arg1\,arg2]]'
@Epigene
Epigene / production.rb
Last active December 21, 2018 01:38
Dokku v0.4.x app production environment file
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = false
config.assets.js_compressor = :uglifier
config.assets.compile = false