Home » Ruby

Ruby

Measuring Performance Metrics in Rails

Performance is a topic many developers value highly, with web frameworks, programming languages, databases, and various technologies all boasting about performance. However, this isn’t usually the first consideration for a web application, as getting a product or service made more quickly is a higher priority. We tend to think about performance once a product/service is in working order and we ...

Read More »

Simplified GitHub Login for a Ruby Web App

You know what OAuth login is, right? It’s when your users click “login” and get redirected to Facebook, Twitter, Google, or some other website which then identifies them. Then they go back to your website and you know who they are. It’s very convenient for them. It’s convenient for you too, since you don’t need to implement the login functionality ...

Read More »

Creating a Rusty Rocket fuelled with Diesel

Sorry if that title seemed stupid. The super serious title would be “Creating a REST API in Rust using Rocket and Diesel”, but that’s boring. Anyway… Here I go with my first post that fully focuses on Rust. After spending a few months doing a bit here and there I decided to just dive right in as I was going ...

Read More »

Using Genetic Algorithms in Ruby

Did you know that there’s a way to use the power of natural selection to solve programming challenges? With genetic algorithms (GA), you can solve optimization problems using the same concepts that you find in nature: Reproduction Survival of the fittest Adaptation to the environment So what’s an optimization problem? It’s when you want to find not just a valid ...

Read More »

Rust for Java Devs – Structs

Next up in Rust for Java Devs we have structs. They are used to hold data within a logical unit that can be passed to other functions or execute their own methods on the values that they store. Now this sounds very familiar… Java objects do the same thing. For example if you took a POJO (Plain Old Java Object) ...

Read More »

Rust for Java Devs – Creating functions

In this post of Rust for Java Devs we will look at creating functions in Rust. Functions in Rust do not differ that much from Java methods but there are a few little differences. There is also the topic of Rust’s lifetimes compared to Java’s garbage collection that one could argue separates the two from each other a bit more, ...

Read More »

Understanding Rust Loops

When you come from another language to learn Rust, some things may come across the same, but many things will be very different. Writing Rust loops can have the appearance of familiarity, but behind the scenes, Rust is translating those loops to its own syntax. If you learn that style for yourself, you will find Rust loops to be far ...

Read More »

Improving Performance by Writing a Custom Static Asset Server in Rust

The ability to serve static assets is critical for many SaaS products, including Shopblocks. Many of these products will store the files to be served in a segmented way, perhaps across multiple drives, and in multiple folders. At Shopblocks, our setup means that each customer has their assets stored on specific mounted drives, and in specific folders per customer. For ...

Read More »

Rust for Java Devs – Compiling code and using Cargo

After my last post seemed to be well received I am back with another Rust for Java Devs post. Today we will look at a compiling Rust code and have a brief look at using the basics of Cargo. For a developer there isn’t much difference between how to compile Rust code compared to Java, but where they vary are ...

Read More »