Straight to Maintenance
Initialize the droplet with dokku app pre-setup
Initialize the droplet with dokku app pre-setup
Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.
Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.
As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.
Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.
#!/usr/bin/env bash | |
echo " | |
---------------------- | |
NODE & NPM | |
---------------------- | |
" | |
# add nodejs 10 ppa (personal package archive) from nodesource | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - |
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,700'); | |
html, body { | |
height: 100%; | |
width: 100%; | |
} | |
body { | |
font-family: 'Open Sans', sans-serif; | |
font-weight: 400; |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)# https://github.com/rails/rails/issues/30917#issuecomment-337895075 | |
# Common connection class | |
# app/channels/application_cable/connection.rb | |
module ApplicationCable | |
class Connection < ActionCable::Connection::Base | |
identified_by :current_user | |
def connect | |
self.current_user = find_verified_user | |
end |
mkdir ~/pg_backup/ | |
sudo -u postgres pg_dump test > pg_dump | |
tar -cvf ~/pg_dump.tar ~/pg_dump | |
rm -rf ~/pg_dump | |
#https://github.com/andreafabrizi/Dropbox-Uploader | |
~/dropbox_uploader.sh upload ~/pg_dump.tar /pg_dump.tar | |
rm ~/pg_dump.tar |
@import "https://fonts.googleapis.com/css?family=Poppins:300, 400, 500, 600, 700";.iziToast-capsule{font-size:0;height:0;width:100%;transform:translateZ(0);backface-visibility:hidden;transition:transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1)}.iziToast-capsule,.iziToast-capsule *{box-sizing:border-box}.iziToast-overlay{display:block;position:fixed;top:-100px;left:0;right:0;bottom:-100px;z-index:997}.iziToast{display:inline-block;clear:both;position:relative;font-family:'Lato', Tahoma, Arial;font-size:14px;padding:8px 45px 9px 0;background:rgba(238,238,238,0.9);border-color:rgba(238,238,238,0.9);width:100%;pointer-events:all;cursor:default;transform:translateX(0);-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:54px}.iziToast>.iziToast-progressbar{position:absolute;left:0;bottom:0;width:100%;z-index:1;background:rgba(255,255,255,0.2)}.iziToast>.iziToast-progressbar>div{h |
set
initialize
: once, when the controller is first instantiatedconnect
: anytime the controller is connected to the DOM