if you're using fish shell, you can add this in your fish config:
let g:fzf_colors = {
\ 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],| -- turn off paging (less/more) | |
| psql> \pset pager off | |
| /* | |
| Pager usage is off. | |
| */ | |
| -- find an object name by id | |
| SELECT OID, relname |
| // first run: | |
| // yarn add glob-all purgecss-webpack-plugin --dev | |
| /* | |
| config/webpack/environment.js | |
| PurgeCSS configuration for Rails 5 + Webpacker + Tailwind CSS + Vue.js | |
| Optionally, put this in production.js if you only want this to apply to production. | |
| For example, your app is large and you want to optimize dev compilation speed. | |
| */ |
| # taken from https://mrbrdo.wordpress.com/2013/09/25/manually-preloading-associations-in-rails-using-custom-scopessql/ | |
| # collection association e.g. has_many | |
| owners = People.all | |
| association_name = :photos | |
| owners.each do |owner| | |
| records = Array(whatever_you_want) | |
| # Make Mixpanel work with Rails Active Job. | |
| # Should work with any background job backend. | |
| class MixpanelAsyncTracker < Mixpanel::Tracker | |
| def initialize | |
| super(ENV['MIXPANEL_TOKEN']) do |*message| | |
| SendMessage.perform_later(message.to_json) | |
| end | |
| end |
| require 'strscan' | |
| class Parser | |
| def initialize string | |
| @scanner = StringScanner.new string | |
| end | |
| def self.eval string | |
| self.new(string).expr |
HexaPDF is a pure Ruby library with an accompanying application for working with PDF files. In short, it allows
Slides : https://speakerdeck.com/derekprior/in-relentless-pursuit-of-rest Talk : https://www.youtube.com/watch?v=HctYHe-YjnE
REST help rails growing
More small things (small models, controllers, services, views...)
[Anti-pattern] Custom actions
noun#verb_noun (users#edit_password, users#update_password) = Missing resourceThe best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.
Example:
# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com