Timeless Advice for Programmers
In the ever-evolving world of software development, technology may change rapidly, but certain...
Read Moreby Jay Luong | Aug 19, 2024 | Networking, Programming | 0 |
In the ever-evolving world of software development, technology may change rapidly, but certain...
Read MoreClasses Classes are one of the building blocks of object-oriented programming. Think of them as blueprints for creating objects. When we just throw variables and methods inside a Ruby file, it’s very loosely associated....
Read MoreSymbols are just a way to name something. Typically it’s used to name attributes in a class or for options (colors, types of cuisines, type of shoe, etc). In essence, a constant string. Use Strings instead of a...
Read MoreMethods are great for DRYing up your code and organizing logic in a single place. They act a little bit like a black box. Here are some tidbits that might not be so obvious with Ruby methods. All methods have to be called on an...
Read MoreVariables in Ruby are basically pointers to an object in memory (heap). a = “bacon” puts “a’s object id: #{a.object_id}” # b points to the same Object as a b = a puts “b’s object id:...
Read MoreSometimes we need to make our code more expressive and tidy but at the same time flexible and easier to use. Learning how to use Ruby blocks appropriately will level you up as a Ruby programmer. Sometimes we like to...
Read MoreGeneral rule of thumb is if you have a collection of objects, you should build custom iterators so that users could readily use them like they do with other collection such as Array, Hash, File, etc. The easiest way to do this...
Read MoreGenerally if your class has an array/hash, sometimes you don’t want to expose the implementation of those collections outside of the object. Creating your own iterator will make your object easier to use. class Headphone...
Read MoreSometimes the scope of a local variable is a bit confusing when working with blocks. For example, the following will result in an “undefined local variable” for variables “x” and “bacon”...
Read Moreby papadiddydoo | Apr 4, 2016 | Rails | 0 |
Getting the following error when running annotate for my models …/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require’: No such file to load — google/api_client (LoadError) Try downgrading...
Read Moreby papadiddydoo | Jan 9, 2016 | Ruby, Ubuntu | 0 |
An error occurred while installing json (1.8.3), and Bundler cannot continue. Install this package first. sudo apt-get install libgmp3-dev running the following ubuntu 14.04 ruby 2.2.3 rvm...
Read Moreby papadiddydoo | Jan 9, 2016 | Ruby, Ubuntu | 0 |
Install the following ubuntu packages first sudo apt-get install imagemagick libmagickwand-dev running ubuntu 14.04 rvm 1.26.11 ruby 2.2.3
Read More
Recent Comments