CJ Avilla
CJ Avilla
  • 337
  • 664 227
BCrypt Password basics in Ruby
This video explains how to use the Bcrypt password class in Ruby to securely hash and store passwords. We'll look at how a user's encrypted password is stored in the database as a hashed string that can't be reversed. To check if a password matches, you initialize a Bcrypt::Password object with the hashed password, then compare it to a plain text password using the == operator, which Bcrypt overrides to check if the hashes match.
Bcrypt handles salting and key stretching internally to make brute force attacks harder. When creating a hash, Bcrypt takes time to run its key derivation function, which can be configured by increasing the cost parameter. We'll look at how to check properties of a bcrypt password like cost, version, and valid hash.
Overall, bcrypt provides a simple interface in Ruby for securely hashing passwords. By storing the bcrypt password hashes rather than plain text passwords, the passwords are securely encrypted at rest in the database. Bcrypt is an industry-standard for password hashing.
#rubyonrails #ruby #rails
zhlédnutí: 391

Video

Basic Posthog API integration - Add A Feature
zhlédnutí 483Před 4 měsíci
In this video, we'll work on a feature to integrate PostHog analytics into the Craftwork web application. We create a Rails model to store marketing attribution data from PostHog called TrafficSource. The job fetches session data from the PostHog API, parses it, and stores relevant marketing metadata like UTM parameters, click IDs, referrers etc. in the TrafficSource model. Tests are written to...
Shoelace, Pick, and Enumerators - Day 18 - Advent of Code 2023
zhlédnutí 320Před 4 měsíci
In this Advent of Code 2023 video, you’ll learn how to solve the "Lava Duct Lagoon" puzzle from Day 18. We walk through calculating the area of a complex polygon shape based on a set of digging instructions. The key techniques and concepts covered are: - Parsing direction, step count, and color instructions - Visualizing the polygon by drawing it on a grid - Applying the Shoelace Formula to cal...
Heaps of fun with shortest paths - Day 17 - Advent of Code 2023
zhlédnutí 155Před 4 měsíci
In this episode you'll learn how to solve day 17's "Clumsy Crucible" puzzle. We walk through implementing a shortest path algorithm to find the route through a grid-based map with the lowest "heat loss". Using a greedy approach to explore minimum heat paths first Implementing a visited set to avoid exploring already visited states Switching from arrays to a heap data structure for faster state ...
grid traversal with pattern matching - Day 16 - Advent of Code 2023
zhlédnutí 135Před 4 měsíci
In this episode of the Advent of Code 2023 solutions series, we tackle day 16, The Floor Is Lava, using Ruby. We start by examining the puzzle input, representing a contraption through which a beam of light travels. The beam interacts with different components like mirrors, splitters, empty spaces, etc. Our goal is to follow the path of the beam and count the number of "energized" tiles it trav...
ASCII values with ord and delete_if - Day 15 - Advent of Code 2023
zhlédnutí 90Před 4 měsíci
In this video, you’ll learn how to solve day 15 of the Advent of Code 2023. The first part involves writing a hash function to convert initialization sequences like "rn=1" into decimal values between 0-255. The hash function works by: 1. Getting the ASCII code for each character using .ord 2. Multiplying the current value by 17 3. Taking modulo 256 to get the final hash value For part 2, the in...
transpose, reverse, roll! - Day 14 - Advent of Code 2023
zhlédnutí 141Před 4 měsíci
In this video, you’ll see how to solve Day 14 for the Advent of Code 2023 Part 1 and Part 2. The puzzle involves manipulating a grid representing a panel with rocks on it. The goal is to tilt the panel north, south, east and west to get the round rocks to roll around. In Part 1, we’ll write a "roll" method to move the round rocks on a single row all the way to the left by swapping spaces. Then ...
partition and inject intersection &:& 👯‍♂️ - Day 13 - Advent of Code 2023
zhlédnutí 109Před 4 měsíci
In this episode, we solve day 13 of Advent of Code 2023, called "Point of Incidence", where we're trying to find lines of symmetry in patterns of dots and pound signs representing mirrors on Lava Island. First, we parse the input into arrays of character arrays representing each pattern. Then we write some methods to check if a line is symmetrical around a given point, find all points of symmet...
Caching and Pattern matching - Day 12 - Advent of Code
zhlédnutí 255Před 4 měsíci
In this episode, we walk through solving day 12 of Advent of Code 2023, called "Hot Springs". The challenge involves parsing records of hot springs, some of which are damaged (#) or operational (.), along with checksums indicating groups of damaged springs. First, we set up some test cases and write a parse method to process the input. Then we implement a count method using recursion and patter...
combination, filter_map - Day 11 - Advent of Code
zhlédnutí 219Před 4 měsíci
Join me as we traverse the cosmos while solving Day 11 of Advent of Code 2023 - Cosmic Expansion - in Ruby! In this coding galaxy quest, we'll: Parse an image grid of galaxies and empty space Expand the grid by inserting extra rows and columns Find all galaxy locations and calculate distances Generate combinations of galaxies to compare Refactor distance to handle cosmic doubling Scale empty sp...
Point in polygon - Day 10 - Advent of Code
zhlédnutí 219Před 4 měsíci
Join me to solve Day 10 of Advent of Code 2023 - The Pipe Maze - in Ruby! In this coding challenge, we'll navigate a grid map of different pipe connections to: Parse the input grid data Find starting points and valid neighbors Traverse around the pipe loop to map its path Determine enclosed tiles inside the loop Use raycasting logic to count wall intersections Handle tricky cases like squeezed ...
each_cons, and layers 🎂 - Day 09 - Advent of Code 2023
zhlédnutí 145Před 4 měsíci
each_cons, and layers 🎂 - Day 09 - Advent of Code 2023
lcm, rotate!, and modulo - Day 08 - Advent of Code 2023
zhlédnutí 201Před 5 měsíci
lcm, rotate!, and modulo - Day 08 - Advent of Code 2023
Spaceship operator - Day 07 - Advent of Code 2023
zhlédnutí 231Před 5 měsíci
Spaceship operator - Day 07 - Advent of Code 2023
Percent delimiters %w, zip - Day 06 - Advent of Code 2023
zhlédnutí 167Před 5 měsíci
Percent delimiters %w, zip - Day 06 - Advent of Code 2023
Range overlap and intersection - Day 05 - Advent of Code
zhlédnutí 397Před 5 měsíci
Range overlap and intersection - Day 05 - Advent of Code
Rightward Assignment in Ruby - Day 04 - Advent of Code 2023
zhlédnutí 397Před 5 měsíci
Rightward Assignment in Ruby - Day 04 - Advent of Code 2023
Grid of Characters - Day 03 - Advent of Code 2023
zhlédnutí 465Před 5 měsíci
Grid of Characters - Day 03 - Advent of Code 2023
Pattern matching with Ranges - Day 02 - Advent of Code 2023
zhlédnutí 449Před 5 měsíci
Pattern matching with Ranges - Day 02 - Advent of Code 2023
Match and Scan - Day 01 - Advent of Code 2023
zhlédnutí 843Před 5 měsíci
Match and Scan - Day 01 - Advent of Code 2023
Jupyter with Ruby and Rails (plus OpenAI function calling)
zhlédnutí 757Před 5 měsíci
Jupyter with Ruby and Rails (plus OpenAI function calling)
Chatbot with Ruby on Rails, Turbo Streams, and OpenAI
zhlédnutí 2,8KPřed 6 měsíci
Chatbot with Ruby on Rails, Turbo Streams, and OpenAI
Semantic search (search by meaning) - Rails, OpenAI, langchain.rb, pg_vector
zhlédnutí 2KPřed 6 měsíci
Semantic search (search by meaning) - Rails, OpenAI, langchain.rb, pg_vector
Fun with Rails Generators
zhlédnutí 779Před 7 měsíci
Fun with Rails Generators
Sales Handoff - Hacking on a handoff process from sales to operations
zhlédnutí 371Před 7 měsíci
Sales Handoff - Hacking on a handoff process from sales to operations
Rails Performance Tips and Tricks
zhlédnutí 2KPřed 7 měsíci
Rails Performance Tips and Tricks
Image upload for markdown input with Stimulus and ActiveStorage
zhlédnutí 1,1KPřed rokem
Image upload for markdown input with Stimulus and ActiveStorage
Using pinecone vector db from Rails with OpenAI for semantic search
zhlédnutí 2KPřed rokem
Using pinecone vector db from Rails with OpenAI for semantic search
Recursively summarize blog posts with OpenAI and Ruby on Rails
zhlédnutí 1,4KPřed rokem
Recursively summarize blog posts with OpenAI and Ruby on Rails
Monkey Math evaluating expressions - Advent of Code 2022 day 21 with Ruby
zhlédnutí 299Před rokem
Monkey Math evaluating expressions - Advent of Code 2022 day 21 with Ruby

Komentáře

  • @paulhetherington3854

    And all - of this: "Be static only!" On Radar - Oriental Tribal! You cannot - use index - i.e. static! I.e. -- < body f(mx'')> I tried bellow - i.e. i R'' -- index Reactant - 2nd derivative + v8''(velocity)! And DOC -- Oriental MD!

  • @paulhetherington3854

    ATTN: "68' -- SAN BN CLAIBORNE- ACT!" Ban on - "Child birth!" From: "68' till 90s!" U weren't, born - in 68' -- 90s! Vet Viet = Beat nick -- Sheriff Deputies - Nat Grd - US ABN - Coast GRd! --GUATEMALA -- GUDZ - not Samoan! -- US really - screwed up - Hindoo nazi! I.e. Hisraelerz - i.e. Israel

  • @paulhetherington3854

    /i R''(v8'')~tmp <body f(mx'')> [2'h=chutz : yxz=h2'' fiji ops]/ /< 2'kf''~tmp(vk8'') zX''|pn|~rul chkz body~tmp wrd art/ /4'fz sfr mch abv~tmp crdt LN'' skor~tmp R2'' ext D''/ /cntr LN''~tmp wrd art f(mcx''T'(2''t)n'') rul body~chutz/ /i.e. fz 68' wn lim r'' eml~tmp abv chutz || fiji ops/

  • @ahmadzaheer8757
    @ahmadzaheer8757 Před 6 dny

    Can I use action mailbox for google?

  • @taab84
    @taab84 Před 9 dny

    Rails team really need to improve active record, except this issue Ruby is faster than people think

  • @piotrekdabrowski7516
    @piotrekdabrowski7516 Před 11 dny

    Is there any github with code?

  • @sargaaaifyful
    @sargaaaifyful Před 12 dny

    Thanks so much for this series of videos, learning a lot here !

  • @mattfoulgerBC
    @mattfoulgerBC Před 12 dny

    thanks dude, very helpful

  • @meederr
    @meederr Před 20 dny

    CJ, How does Zillow "remember" drawn boundary polygons? I see Lat/long for NSEW, but nothing else? Is it possible to find that out?

  • @mariobroselli3642
    @mariobroselli3642 Před měsícem

    Why is it not even used!? I see vue.js to be more popular for example. Even java's spring is more used.

  • @RafikD.
    @RafikD. Před měsícem

    before_save callback seems to be not really recommanded, do you suggest another way to achieve what you did ? Thanks

  • @cmthimmaiah
    @cmthimmaiah Před měsícem

    Simple and clear, thanks a ton.

  • @japanesewithnana
    @japanesewithnana Před měsícem

    Thank you so much for this series!

  • @lucazefferi5881
    @lucazefferi5881 Před měsícem

    but why i cant just do this? require 'bcrypt' hash = BCrypt::Password.create("1234") puts "Hash: #{hash}" if hash == "1234" puts "correct " else puts "incorrect" end

  • @alexanonym1584
    @alexanonym1584 Před měsícem

    So you have a repo with this examples?

  • @joshsantos9536
    @joshsantos9536 Před měsícem

    Why is it taking several seconds to run the test?

  • @Average_Aoe_Believer
    @Average_Aoe_Believer Před měsícem

    Good job man you like actually saved my life (i got an exam tomorrow...)

  • @MuhammadUsman-lp4sm
    @MuhammadUsman-lp4sm Před měsícem

    I was looking for exactly this piece of JS and C# code behind for WebForms. It is just not easy to read Stripe documentation and write all this. It really really helped a great deal. Thanks!

  • @rujor
    @rujor Před měsícem

    "Is Ruby on Rails dead? The answer is .." *scrolls*

  • @rubyxfinity8634
    @rubyxfinity8634 Před měsícem

    It's 2023 and this still remains VERY relevant. Developers seem to forget that there is a TON of legacy .NET Framework 4.8 and earlier code that is still reliable, running and in production, and will be probably for another 10-15 years entirely as-is with no plans to "upgrade". So if developers suggest STRIPE as an alternative, but there's no good sample code for implementing it, they will have to move on to something else. This was great, but you skipped how to handle the results.

  • @Cabugamer
    @Cabugamer Před měsícem

    Your videos are amazing, but something that I'm really jealous of is your control of Vim...

  • @abdullahsaleh7196
    @abdullahsaleh7196 Před měsícem

    keep going

  • @mikapp802
    @mikapp802 Před měsícem

    Thank you CJ!! all your videos are very helpfull 🙏🙏

  • @batterybikes
    @batterybikes Před měsícem

    Hey I'm excited to work through this playlist. Thanks for putting this together. I'm sure it will become clear later, but I'm wondering why you chose to have a database backed version of your videos at all. It seems like it would make more sense for your models to just be POROs that are just backed by API calls. Will keep watching!

  • @mikapp802
    @mikapp802 Před měsícem

    Thank you so much !!! amazing the first one explain stripe step by step, i like all your videos , i have learn a lot from you , thanks again CJ!

    • @cjav_dev
      @cjav_dev Před měsícem

      Thanks for watching! Glad to hear it was useful.

  • @user-ku5cb6ws8g
    @user-ku5cb6ws8g Před měsícem

    A great video, thank you so much.

  • @kasetophono
    @kasetophono Před měsícem

    This is a brilliant tutorial! You deserve more views

  • @zuhaibamjad7668
    @zuhaibamjad7668 Před 2 měsíci

    you deserve more appreciation bro. keep the good work up.

  • @pratapanurag757
    @pratapanurag757 Před 2 měsíci

    Hey really liked the video, but being an editor i can confidently say there's a room for improvement like titles are not discoverable, the thumbnails and content could be made more engaging postproduction, if you feel there's something that we can about, then i open to reading your reply)

  • @Paul_Angel
    @Paul_Angel Před 2 měsíci

    Hello! Is it worth learning Ruby in 2024?

  • @tahamanna3600
    @tahamanna3600 Před 2 měsíci

    Great video, thanks!

  • @samotxd
    @samotxd Před 2 měsíci

    I stumbled upon this playlist while searching (for longer than I care to admit) for an approach to trigger the stimulus controller actions precisely in this way. Your video saved me valuable time, thanks a lot pal!

  • @user-rh1vx8md7z
    @user-rh1vx8md7z Před 2 měsíci

    HI, excellent presentation. Can you mention the repository link in the description?

  • @lappi_wojak
    @lappi_wojak Před 2 měsíci

    wow, I never heard of 'lcm' before your video. Great idea.

  • @jonspooner
    @jonspooner Před 2 měsíci

    Thanks for sharing

  • @hugovillero6934
    @hugovillero6934 Před 2 měsíci

    Nice video. Thanks. One question I'm impressed with is your VIM setup for rails. Is that NeoVim? Where can I find a guide to configure it that way for Mac? Thanks again.

  • @wahibakamoulcode
    @wahibakamoulcode Před 2 měsíci

    use Arc

  • @JosephLKausi
    @JosephLKausi Před 2 měsíci

    Thanks for what you're doing CJ, I'm a beginner with Ruby, but when I watch your videos, it motivates me to think that one day I'll be able to reach your level. From DRC

    • @cjav_dev
      @cjav_dev Před 2 měsíci

      Thanks for watching, Joseph! You can totally do it.

  • @TheInfamousAlpha
    @TheInfamousAlpha Před 2 měsíci

    This was really helpful - thanks CJ!

  • @mutebiugofficial8827
    @mutebiugofficial8827 Před 2 měsíci

    @cj is it possible to use turbo_frames to replace the reply form with the reply button for nested comments!. i have tried it but the state is lost for deep nesting.

  • @WhoIsSeth
    @WhoIsSeth Před 3 měsíci

    Wow this google really makes things crazy hard but you explained it well. Also loved how you don't skip the parts that you are trying to figure out yourself. Loved to see how you debug things and work things out. Thanks you so much!

  • @durpdurp0257
    @durpdurp0257 Před 3 měsíci

    Thanks for clarifying so well haha it’s literally to the point of HTML for dummies😂

  • @user-oj3rm9lw7n
    @user-oj3rm9lw7n Před 3 měsíci

    Hey There! Thanks sir you've helped me a lot. keep forward!

  • @lappi_wojak
    @lappi_wojak Před 3 měsíci

    I did both parts but part2 is so slow for ruby! It takes 25 hours to complete xD who invented those task is crazy

  • @chadlewis2874
    @chadlewis2874 Před 3 měsíci

    This is such a great video, thank you! I’ve been interested in stripe for quite a while now and have been pretty intimidated/overwhelmed by the integration. Huge fan of Remix, and you showed it to be much easier than I expected 😃🙏

  • @jov001
    @jov001 Před 3 měsíci

    Ey Appreciated this kind of short and digestable videos. this is what I actually looking. I stumble here because I searched.

  • @jov001
    @jov001 Před 3 měsíci

    I also looped the video.

  • @sergiobayona
    @sergiobayona Před 3 měsíci

    excellent job explaining this. Thanks!

  • @alejandrogomezanaya6306
    @alejandrogomezanaya6306 Před 3 měsíci

    Thanks for you explanation! It's very clear and specific.