Skip to content

Instantly share code, notes, and snippets.

View lucianosousa's full-sized avatar
💭
🏊 🚴‍♂️ 🏃- 🏋️‍♂️

Luciano Sousa lucianosousa

💭
🏊 🚴‍♂️ 🏃- 🏋️‍♂️
View GitHub Profile
@lucianosousa
lucianosousa / gist:76f0339876263f281146af3dd7dbe80f
Last active February 7, 2021 17:42
Fixing Symbol not found: _ffi_prep_closure_loc error on OSX Mojave
```
dyld: lazy symbol binding failed: Symbol not found: _ffi_prep_closure_loc
Referenced from: /Users/ls/.gem/ruby/3.0.0/gems/ffi-1.14.2/lib/ffi_c.bundle
Expected in: /usr/lib/libffi.dylib
dyld: Symbol not found: _ffi_prep_closure_loc
Referenced from: /Users/ls/.gem/ruby/3.0.0/gems/ffi-1.14.2/lib/ffi_c.bundle
Expected in: /usr/lib/libffi.dylib
Abort trap: 6
@lucianosousa
lucianosousa / install.sh
Last active December 5, 2020 04:31
homebrew install without all branches (only master)
#!/bin/bash
set -u
# Check if script is run non-interactively (e.g. CI)
# If it is run non-interactively we should not prompt for passwords.
if [[ ! -t 0 || -n "${CI-}" ]]; then
NONINTERACTIVE=1
fi
# First check if the OS is Linux.
autocmd BufWritePre * :%s/\s\+$//e
" Auto reload file
au FocusGained,BufEnter * :checktime
let mapleader=","
" Fzf mapping replacing ControlP command
nnoremap <C-p> :Files<Cr>
" Fzf mapping for find in files
autocmd BufWritePre * :%s/\s\+$//e
color desert
let mapleader=","
" Fzf mapping replacing ControlP command
nnoremap <C-p> :Files<Cr>
" Fzf mapping for find in files
nnoremap <C-g> :Rg<Cr>
@lucianosousa
lucianosousa / events_helper.rb
Created August 22, 2019 13:57
sorbet or not sorbet?
# Old file start
module EventsHelper
def user_is_owner?(model)
user_signed_in? && model.user == current_user
end
end
# Old file end
$ lein repl
Mar 18, 2016 7:24:39 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo1.maven.org:443: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
Mar 18, 2016 7:24:39 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo1.maven.org:443
Mar 18, 2016 7:24:39 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://repo1.maven.org:443: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
Mar 18, 2016 7:24:39 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://repo1.maven.org:443
Mar 18, 2016 7:24:39 PM org.
function OffersController($scope, $sce) {
activate();
function activate() {
$('.selectpicker').selectpicker({
style: 'btn-info',
size: 4
});
}
}
require 'active_support'
require 'active_record'
require 'benchmark/ips'
ActiveRecord::Base.establish_connection(
adapter: 'mysql2',
encoding: 'utf8',
reconnect: true,
pool: 25,
host: 'localhost',
@lucianosousa
lucianosousa / benchmark2.rb
Last active January 15, 2016 01:09
Second benchmark for AR queries
require 'active_support'
require 'active_record'
require 'benchmark/ips'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
ActiveRecord::Base.connection.instance_eval do
create_table(:customers) { |c| c.string :name }
end
class Customer < ActiveRecord::Base; end
@lucianosousa
lucianosousa / gist:82cd3ed636f6cd6ce918
Created October 8, 2015 18:35
code analysis gems
https://github.com/DamirSvrtan/fasterer
https://github.com/codeclimate/codeclimate
https://github.com/metricfu/metric_fu