CJ Avilla
CJ Avilla
  • 337
  • 698 165
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
Переглядів: 476

Відео

Basic Posthog API integration - Add A Feature
Переглядів 5646 місяців тому
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
Переглядів 3556 місяців тому
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
Переглядів 1726 місяців тому
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
Переглядів 1487 місяців тому
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
Переглядів 927 місяців тому
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
Переглядів 1457 місяців тому
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
Переглядів 1117 місяців тому
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
Переглядів 2647 місяців тому
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
Переглядів 2287 місяців тому
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
Переглядів 2257 місяців тому
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
Переглядів 1477 місяців тому
each_cons, and layers 🎂 - Day 09 - Advent of Code 2023
lcm, rotate!, and modulo - Day 08 - Advent of Code 2023
Переглядів 2067 місяців тому
lcm, rotate!, and modulo - Day 08 - Advent of Code 2023
Spaceship operator - Day 07 - Advent of Code 2023
Переглядів 2387 місяців тому
Spaceship operator - Day 07 - Advent of Code 2023
Percent delimiters %w, zip - Day 06 - Advent of Code 2023
Переглядів 1717 місяців тому
Percent delimiters %w, zip - Day 06 - Advent of Code 2023
Range overlap and intersection - Day 05 - Advent of Code
Переглядів 4017 місяців тому
Range overlap and intersection - Day 05 - Advent of Code
Rightward Assignment in Ruby - Day 04 - Advent of Code 2023
Переглядів 4017 місяців тому
Rightward Assignment in Ruby - Day 04 - Advent of Code 2023
Grid of Characters - Day 03 - Advent of Code 2023
Переглядів 4737 місяців тому
Grid of Characters - Day 03 - Advent of Code 2023
Pattern matching with Ranges - Day 02 - Advent of Code 2023
Переглядів 4587 місяців тому
Pattern matching with Ranges - Day 02 - Advent of Code 2023
Match and Scan - Day 01 - Advent of Code 2023
Переглядів 8667 місяців тому
Match and Scan - Day 01 - Advent of Code 2023
Jupyter with Ruby and Rails (plus OpenAI function calling)
Переглядів 8208 місяців тому
Jupyter with Ruby and Rails (plus OpenAI function calling)
Chatbot with Ruby on Rails, Turbo Streams, and OpenAI
Переглядів 3,2 тис.8 місяців тому
Chatbot with Ruby on Rails, Turbo Streams, and OpenAI
Semantic search (search by meaning) - Rails, OpenAI, langchain.rb, pg_vector
Переглядів 2,3 тис.9 місяців тому
Semantic search (search by meaning) - Rails, OpenAI, langchain.rb, pg_vector
Fun with Rails Generators
Переглядів 8319 місяців тому
Fun with Rails Generators
Sales Handoff - Hacking on a handoff process from sales to operations
Переглядів 3819 місяців тому
Sales Handoff - Hacking on a handoff process from sales to operations
Rails Performance Tips and Tricks
Переглядів 2,3 тис.9 місяців тому
Rails Performance Tips and Tricks
Image upload for markdown input with Stimulus and ActiveStorage
Переглядів 1,2 тис.Рік тому
Image upload for markdown input with Stimulus and ActiveStorage
Using pinecone vector db from Rails with OpenAI for semantic search
Переглядів 2,1 тис.Рік тому
Using pinecone vector db from Rails with OpenAI for semantic search
Recursively summarize blog posts with OpenAI and Ruby on Rails
Переглядів 1,4 тис.Рік тому
Recursively summarize blog posts with OpenAI and Ruby on Rails
Monkey Math evaluating expressions - Advent of Code 2022 day 21 with Ruby
Переглядів 303Рік тому
Monkey Math evaluating expressions - Advent of Code 2022 day 21 with Ruby

КОМЕНТАРІ

  • @prajitlal562
    @prajitlal562 10 годин тому

    This video is amazing, thank you! Chucked you a follow on twitter as well :)

  • @KidUncommon
    @KidUncommon 2 дні тому

    Wonder what are neat and open web-hooks to play with!

  • @vincentbonnier9333
    @vincentbonnier9333 3 дні тому

    it really really help man ! nice and pedagogical ! i apreciate, thanks a lot from Lyon in France !

  • @barelycodingtoday
    @barelycodingtoday 5 днів тому

    When we look for videos for some help, we want these! What an amazing indepth video. I learned tons!

    • @cjav_dev
      @cjav_dev 5 днів тому

      Thanks for watching!

  • @baylorpate2357
    @baylorpate2357 6 днів тому

    Very helpful, thank you!

  • @haniqassim
    @haniqassim 9 днів тому

    The best part about Ruby on Rails is that when I build something for a client, he’s better off staying with me because it is hard to find RoR devs. It’s my craftsmanship.

  • @streambtsalishacruz2860
    @streambtsalishacruz2860 18 днів тому

    thanks man!

  • @geekychunk
    @geekychunk 18 днів тому

    I do Rails, cause I enjoy it❤🌺

  • @djlclopez128
    @djlclopez128 19 днів тому

    Can you PLEASE do more tutorials on Ruby? It's harder to find YT creators that are Ruby Developers to learn best practices from.

  • @SCBiscuit13
    @SCBiscuit13 22 дні тому

    I think there is an issue here. When you are trying to pass a lambda to the 'each' method. The '&' symbol is converting the lambda into the proc on passing vars to the method.

  • @eduardomaes
    @eduardomaes 25 днів тому

    Awesome!

  • @shashankkestwal4454
    @shashankkestwal4454 28 днів тому

    Please tell me that Rails will not die in the next 5 years.

  • @RiansyahTohamba
    @RiansyahTohamba 28 днів тому

    Thanks CJ🎉🎉

  • @nuttygold5952
    @nuttygold5952 Місяць тому

    “Is ruby on rails fast, well its fast enough for apps that you would build in ruby on rails” ermmm 🫠 P.s. i do agree.

  • @andrewbanfro2143
    @andrewbanfro2143 Місяць тому

    am new here and it seems lectures are pretty awesome thanks

  • @mikapp802
    @mikapp802 Місяць тому

    Amazing explanation!!!!!!! Thank you so much for such videos from Paris 😃😄

  • @daveanvs
    @daveanvs Місяць тому

    Is there a way to know where do dependencies that aren’t causing issues come from? For example if I use angular is there a way for the dependabot to tell me these dependencies are being included cause of angular?

  • @3i33i
    @3i33i Місяць тому

    I love you man

  • @3i33i
    @3i33i Місяць тому

    Love you man

  • @terencewehle4472
    @terencewehle4472 Місяць тому

    Much appreciated! Just what I was looking for.

  • @bobcekaymusic
    @bobcekaymusic Місяць тому

    Thanks for this video dude!

  • @phil-icare
    @phil-icare 2 місяці тому

    CJ (Christopher James?), you are truly the best. An outstanding educator. You teach us exactly what we need to learn: how to navigate through even the most abundant documentation, which is an art in itself. An art that you share exceptionally well, illustrating it wonderfully. Your teaching methods are excellent, and you are an excellent teacher (and this comes from someone who loves pedagogy, saying this with joy). Thank you for everything, from France.

    • @cjav_dev
      @cjav_dev 2 місяці тому

      Wow this made my day. Thanks for the kind words!

  • @Aman-vu9wm
    @Aman-vu9wm 2 місяці тому

    Thanks buddy , Helped a lot!!!!

  • @mgharbik
    @mgharbik 2 місяці тому

    Just one question, you didn't change the config.load_defaults to 7.0, do you have a video about loading the new configs by default and getting rid of the new_framework_defaults_7_0.rb file

  • @salma_techie
    @salma_techie 2 місяці тому

    Perfect content. thank you!

  • @thomasconnolly8201
    @thomasconnolly8201 2 місяці тому

    Cyan is pronounced "sigh-ann' (Cyan, magenta and yellow are the primary subtractive colors, used in printing, my former trade). Thanks for all your great tutorials!

  • @paulhetherington3854
    @paulhetherington3854 2 місяці тому

    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
    @paulhetherington3854 2 місяці тому

    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
    @paulhetherington3854 2 місяці тому

    /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 2 місяці тому

    Can I use action mailbox for google?

  • @taab84
    @taab84 2 місяці тому

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

  • @piotrekdabrowski7516
    @piotrekdabrowski7516 2 місяці тому

    Is there any github with code?

  • @sargaaaifyful
    @sargaaaifyful 2 місяці тому

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

  • @mattfoulgerBC
    @mattfoulgerBC 2 місяці тому

    thanks dude, very helpful

  • @meederr
    @meederr 2 місяці тому

    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 3 місяці тому

    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. 3 місяці тому

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

  • @cmthimmaiah
    @cmthimmaiah 3 місяці тому

    Simple and clear, thanks a ton.

  • @japanesewithnana
    @japanesewithnana 3 місяці тому

    Thank you so much for this series!

  • @lucazefferi5881
    @lucazefferi5881 3 місяці тому

    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 3 місяці тому

    So you have a repo with this examples?

  • @joshsantos9536
    @joshsantos9536 3 місяці тому

    Why is it taking several seconds to run the test?

  • @Average_Aoe_Believer
    @Average_Aoe_Believer 3 місяці тому

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

  • @MuhammadUsman-lp4sm
    @MuhammadUsman-lp4sm 3 місяці тому

    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 3 місяці тому

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

  • @rubyxfinity8634
    @rubyxfinity8634 3 місяці тому

    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 3 місяці тому

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

  • @abdullahsaleh7196
    @abdullahsaleh7196 3 місяці тому

    keep going

  • @mikapp802
    @mikapp802 3 місяці тому

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