Compared to Remote schooling

  • Updated 5 days ago by vince
Run a Rails server on https and localhost

openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt then rails s -b 'ssl://localhost:3000?key=localhost.key&cert=localhost.crt' This will give y...

  • Updated 15 days ago by vince
Foreign exchange accounting

  • Updated 24 days ago by vince
Modeling double entry accounting in a relational database https://c...

  • Updated 29 days ago by vince
Rails Multi Environment Credentials

I ended up deleting master.key and credentials.yml.enc since I'd rather use development and production specific keys and credentials per below ```ruby rails credentials:show --environment=developme...

  • Updated 29 days ago by vince
Pass persisted params in a Rails form

If the params you want to persist are state and order ruby <% request.params.slice('state', 'order').each do |key, value| %> <%= hidden_field_tag key, value %> <% end %>

  • Updated about 1 month ago by vince
Find a process and kill it in terminal

% ps aux | grep ruby lukeko 29806 0.0 0.0 4277500 696 s000 S+ 6:49PM 0:00.00 <process you don't want> % kill -9 29806

  • Updated about 1 month ago by vince

Go to Only extra things left to do is @import "trix/dist/trix";

  • Updated about 1 month ago by vince
Add Stripe to a Rails app

  • Updated 21 days ago by vince
Checkout one from from a previous commit

git checkout c96a579 app/assets/stylesheets/menu.scss

  • Updated about 1 month ago by vince
Override update_counters from counter_cache: true

```ruby class Post < ApplicationRecord belongsto :author, countercache: true end class Author < ApplicationRecord has_many :posts def self.updatecounters(id, counters) Author.find(id).dos...

  • Updated about 1 month ago by vince
Remove folder and all files inside it in Terminal

using rm can be very dangerous if you're not careful -- get in the habit of using mv instead do this mv .git ~/.Trash instead of rm -rf .git the first command is safer on many levels

  • Updated about 1 month ago by vince
Branch from a previous commit on master as though the branch was made before ...

remove the commits from master as though you had made the branch before those commits were made git checkout master git branch branch-name git reset --hard <sha1>

  • Updated about 2 months ago by vince
Create alias to stash untracked files with a message

git config --global alias.stush 'stash push -u -m' then instead of git stash push -u -m "helpful message" you can just do git stush 'helpful message'

Change (Amend) commit message

if you just made a commit and want to change the message git commit --amend -m "better commit message"

  • Updated about 2 months ago by vince
Git stash

takes your uncommitted changes (both staged and unstaged), saves them away for later use, and then reverts them git stash -u git checkout master git checkout crazy-experiment git stash pop stash ...

Serialized Hash in Rails form

review of what a hash is ```ruby schedule = {mon: true, tue: false, wed: true} schedule[:mon] => true schedule[:tue] => false schedule[:wed] => true schedule[:thu] => nil schedule.class => Hash ```...

  • Updated about 2 months ago by vince
Rebase experimental branches

Fake everyone (including yourself) by squashing stupid commits on your experimental branch and then merging a pristine commit to master git checkout -b crazy-experiment do lots of stupid commits ...

Squash experimental branch

git rebase -i [SHA] "squash" melds the commit into the previous one (the one in the line before)

  • Updated about 2 months ago by vince

rails console ``` Running via Spring preloader in process 61215 Loading development environment (Rails irb(main):001:0> a = Availability.first Availability Load (0.8ms) SELECT "availabi...

  • Updated about 2 months ago by vince