Skip to content

Instantly share code, notes, and snippets.

Augusts Bautra Epigene

View GitHub Profile
@Epigene
Epigene / 50.json
Created Jan 10, 2020
Flamegraph for method spec on Rails 5.0
View 50.json
{"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 Jan 10, 2020
Flamegraph for method spec on Rails 4.2
View 42.json
{"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 / settings.json
Created Dec 10, 2019
Gene's VSC general settings, 2019-12-10
View settings.json
{
"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 Dec 10, 2019
Gene's snippets for VSC, 2019-12-10
View ruby.json
{
"service_spec template": {
"prefix": "service_spec",
"body": [
"RSpec.describe $0TODO, :service do",
" let(:options) do",
" {}",
" end",
"",
" describe \"#call\", :implicit_subject do",
View Karabiner custom rules.md

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

View gist:e459b4642552f3bb85b58f6bce775369
SELECT `applications`.* FROM `applications` LEFT OUTER JOIN `agreements` `agreements_f0` ON `applications`.`id` = `agreements_f0`.`application_id` WHERE ((`applications`.`hidden` = ? OR `applications`.`hidden` IS ?)) AND ((LOWER(`applications`.`client_name`) LIKE LOWER(?)) OR (LOWER(`applications`.`client_email`) LIKE LOWER(?)) OR (LOWER(`applications`.`client_identification_no`) LIKE LOWER(?)) OR (LOWER(`applications`.`client_phone`) LIKE LOWER(?)) OR (LOWER(`applications`.`client_phone2`) LIKE LOWER(?)) OR (LOWER(`applications`.`client_phone3`) LIKE LOWER(?)) OR (LOWER(`applications`.`client_phone4`) LIKE LOWER(?)) OR (LOWER(`applications`.`vehicle_no`) LIKE LOWER(?)) OR (LOWER(`applications`.`vehicle_vin`) LIKE LOWER(?)) OR (LOWER(`applications`.`vehicle_no2`) LIKE LOWER(?)) OR (LOWER(`applications`.`vehicle_technical_certificate_no`) LIKE LOWER(?)) OR (LOWER(`applications`.`vehicle_technical_certificate_no2`) LIKE LOWER(?)) OR (LOWER(`applications`.`number`) LIKE LOWER(?)) OR (LOWER(`applications`.`reque
@Epigene
Epigene / ruby.json
Last active Aug 31, 2018
Ruby (predominantly RSpec) snippets for VSC.
View ruby.json
{
"scope spec template": {
"prefix": "scope_spec",
"body": [
"describe \".SCOPE_NAME\" do",
" subject(:collection) { described_class.SCOPE_NAME }",
"",
" context \"when instantiating actual records\", :slow do",
" let!(:match) { create(:FACTORY, :TRAIT) }",
" let!(:counter) { create(:FACTORY) }",
@Epigene
Epigene / Nim Spells.md
Created Jul 17, 2018
Some know-how and cheats for Nim programming languages
View Nim Spells.md

Compiling with the -d:release flag will turn the bounds checks off. This will result in higher performance but less safety.

View settings.js
{
"workbench.colorTheme": "Solarized Dark",
"editor.minimap.enabled": false,
"explorer.fontFamily": "DejaVu Sans Mono",
"explorer.autoReveal": false,
"editor.fontFamily": "DejaVu Sans Mono, 'Courier New', monospace, 'Droid Sans Fallback'",
"editor.tabSize": 2,
"editor.fontSize": 12.5,
"window.zoomLevel": 1,
"editor.rulers": [80, 120],
@Epigene
Epigene / test_service.rb
Created Feb 23, 2018
An example of a service class code created by a rails service generator
View test_service.rb
module V1
module Api
class TestService
# This service TODO
def initialize
end
def call
end
You can’t perform that action at this time.