This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your config/initializers/ folder. | |
if Kernel.const_defined?('ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter') | |
ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.emulate_booleans = false | |
# Version 7.0.2 of activerecord-oracle_enhanced-adapter loads the types into | |
# a constant TYPE_MAP when the class is loaded | |
# | |
# This is so early in the process that there is no opertunity to change the | |
# default value of emulate_booleans, so that config is ineffective in that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" .config/nvim/init.vim | |
" Plugins | |
call plug#begin(stdpath('config') . '/plugins') | |
Plug 'neovim/nvim-lspconfig' | |
Plug 'stevearc/aerial.nvim' | |
Plug 'tpope/vim-rails' | |
Plug 'tpope/vim-fugitive' | |
Plug 'tpope/vim-surround' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'Show basic controller usage stats' | |
task :controllers => :environment do | |
logfiles = Dir['log/%s.log*' % Rails.env].sort | |
logs_gz, logs_txt = logfiles.partition{|f| Pathname.new(f).extname == '.gz' } | |
results = `ag Started -A 1 #{logs_txt.join(' ')}` | |
unless logs_gz.empty? | |
results << `zcat #{logs_gz.join(' ')} |ag Started -A 1` | |
end | |
Event = Struct.new(:http_method, :uri_path, :client_ip, :requested_at_str, :controller_name, :controller_action, :format) do | |
def requested_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# gather a few statistics and find all flagged comments | |
# | |
# Usage: | |
# rfluff [-qf] [tag] [tag] ... | |
# | |
# -qf outputs a vim compatible quickfix format, otherwise | |
# the output is human readable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I have lots of projects. As I do the rails upgrades I collect the pin changes and other adjustments here | |
# towards the end of upgrading all the projects it gets easier and easier because of these commands. | |
❯ ./rails-upgrade | |
Commands: | |
rails-upgrade apple_touch # add blank apple-touch icons | |
rails-upgrade application_record # adds ApplicationRecord and replaces all references to ActiveRecord::Base with it | |
rails-upgrade asset_precompile_check # look for assets that need to be added to the assets initializer precompile list | |
rails-upgrade assigns_check # the assigns method has been extracted to a gem, check if it is used, and add the gem | |
rails-upgrade before_filter # change before_filter to before_action in controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'active_support/all' | |
require 'pp' | |
require 'rainbow' | |
require 'terminal-table' | |
$show_all = ARGV.include? '--all' | |
$undeployed = ARGV.include? '--undeployed' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Presumes your projects are in subdirectories of the current directory | |
./gem-versions.rb rails # Show you what rails versions are used across your projects, noting the latest | |
./gem-versions.rb --outdated # show you all the outdated gems across all your projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# gather a few statistics and find all flagged comments | |
# | |
# Usage: | |
# rfluff [-qf] [tag] [tag] ... | |
# | |
# -qf outputs a vim compatible quickfix format, otherwise | |
# the output is human readable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
@records = Record.filter_params(params[:filters]) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The icons are all squares. |