~ ❯ ls Movies/*
Movies/Final Cut Backups.localized:
Untitled
Movies/Motion Templates.localized:
Movies/Untitled.fcpbundle:
CurrentVersion.flexolibrary Lib Settings.plist __Temp
CurrentVersion.plist Motion Templates.localized __Sync__ fuhh
~ ❯ ls Movies/*/*
Movies/Untitled.fcpbundle/CurrentVersion.flexolibrary Movies/Untitled.fcpbundle/Settings.plist
Movies/Untitled.fcpbundle/CurrentVersion.plist Movies/Untitled.fcpbundle/__Sync__
Movies/Final Cut Backups.localized/Untitled:
20170730_2014_EDT.fcpbundle Previous Versions.localized
Movies/Untitled.fcpbundle/Lib:
CurrentVersion.fcpevent Render Files Shared Items
Original Media Share Transcoded Media
Movies/Untitled.fcpbundle/Motion Templates.localized:
Movies/Untitled.fcpbundle/__Temp:
Movies/Untitled.fcpbundle/fuhh:
CurrentVersion.fcpevent Render Files Transcoded Media
Original Media Shared Items fuuuuhhh
⌘+D
hightlight the next instance of the current selection for easy edits
⌘+SHIFT+ENTER
new line above current line
⌘+[``⌘+]
indent left and right
Explosive.new(item_name: "Explosive Sheep", description: "Baahhhhd Dreams", cost: "18 silver")
is a valid hash in Ruby. Because it looks nice so it must be valid. Everything is optional!
I get why modules are a thing now!
Inheritence is useful but gets really gross really fast with Classes. Choosing what inherits from what quickly gets dicey. Enter modules! Inherit from modules into multiple classes to keep your code dry and less confusing. Wrap modules / classes in more modules to name space them
It clears the screen.
system "clear"
That's it.
IDK dude but it blew my mind
While trying to reverse an array without using .reverse
, I was introduced to pop
of the array instance method.
This article eloquently accomplished what I was trying to do and explains the method nicely.
(thanks to heatherkylee for the link)
Rails has a built in method (method?) to seed your database with info. Helpful for testing and play.
To do this wonderful thing :
use faker for varience, and also fun.
10.times do
new_user = Contact.new( first_name: Faker::Name.first_name,
last_name: Faker::Name.last_name, email: Faker::Internet.email,
phone_number: Faker::PhoneNumber.phone_number, crazy: Faker::Boolean.boolean )
new_user.save
end
then call the method. I think its a method. IDK I haven't gotten that far.
cd $rails_app
rails db:seed
Boom! Fake data.
Replace Model.new
/ Model.save
with create!
Saves a step and fails loudly if you did it wrong.
You can pass data into your app with routes and params. I've been doing this via curl forever but the pieces didn't fit together quite so well until I learned this.
query params:
get /random_url/ => random#random_number_action
"foo.com/random_url/?id=4"
segment params:
get /other_random_url/:params => random#other_random_number_action
"foo.com/random_url/4"
Are there other routes? Maybe! Oh man.