I’ve recently added AWS S3 storage capability to my Rails Backend. Users can upload profile pictures that are then stored in an S3 bucket.
If you are interested in finding out more about how to implement such a photo (or any file, really) upload feature in your React app, I suggest you refer to on of my older posts about cropping and uploading images in a React app using react-image-crop.
The files are actually being uploaded from my React single page application then turned into blobs in my Rails API.
A blob is a record that contains the metadata about a file and a key for where that file resides on the…
Async/await
is one of the most revolutionary features that has been added to JavaScript in the past few years. It offers an intuitive replacement to the syntactical mess that promises sometimes tend to be.
There is nothing wrong with the good old Fetch API, which is made available by default to make ajax requests and more.
“The Fetch API provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline, such as requests and responses. It also provides a global
fetch()
method that provides an easy, logical way to fetch resources asynchronously across the network.” …
React offers several options when it comes to styling your components. We can always put our styles in a .css file and import it but I’m a big fan of taking advantage of the mental model React offers with JSX by coupling JavaScript, HTML, and styling together in one place. It does come with certain limitations though. There are some common CSS features and techniques that inline styles don’t easily accommodate: media queries, browser states (:hover, :focus, :active) and modifiers.
Let’s consider the following problem — by default we can’t assign a hover style for our button short of using a .css file (button:hover). Hover is not a css property and we cannot change its value on our style object. As we mentioned before, we could simply work around this by styling the button in the .css file the drawback being that the style would not be scoped to this component only, and all the buttons in our application would get the styling unless we added an id or a class. Personally, I don’t like having to jump to the .css …
My time is too precious to do manual testing every time I make a change to my app. And by manual testing, I mean clicking around my app every time I add a few lines of code to make sure I didn’t break anything.
Sometimes, I would happily and naively assume component C could not possibly be affected by changes made in component A only to discover much later, that something indeed did break and I now have to drop a bunch of debuggers and see where I went wrong (it’s usually a typo, but we can’t always be this lucky). …
An Observable is like a data source. In an Angular project, it’s an object we import from a third-party package, rxjs. The observable here is implemented by following an observable pattern where we have an observable and an observer and in between, we have a timeline where we can have multiple events, or data packages, emitted by the observable (depending on the data source of the observable). These events can be triggered programmatically, by user interaction, like a button, HTTP requests, and dozens of other data sources.
No, not the one from Fringe. Who or what is the observer then? It is actually our code, our “observing”, so to say, via a subscribe() function. …
with JavaScript examples
It is notoriously hard to learn and is a huge topic that many books have been written about dynamic programming algorithms. We are here to cover the basics. In order to understand dynamic programming, you have to be comfortable with recursion. If you need a refresher, you are in luck, I recently wrote about my own adventures with recursion and memoization — JavaScript Recursion and Memoization for Dummies.
So what is dynamic programming?
In a nutshell, it’s a method of solving a complex problem by breaking it down into a collection of smaller subproblems, solving them just once, and storing their solution. …
An iterable function is one where we have access to a built-in iterator. In JavaScript, Arrays, Maps, Strings are iterable, but Objects are not. The operator provides individual pieces, values of the Object.
An enumerable function looks at the properties of the objects, not the values.
To put it as simply as possible — For…in will loop through property names and for…of will loop through property values.
Used for enumerable objects, that is objects that have enumerable properties — Ones you can count and where order matters. …
I actually enjoy timed code assessments. It is thrilling to see how fast I can come up with a solution to a problem under pressure. Yet it never feels like my best work, and I often wonder if one day I’ll be able to come up with good, optimized, clean code solutions fast or if those timed results will always be more of a first draft.
Once I come up with a working solution, it often feels like the work is not really done. I don’t obsess about it either, though. There is a sense of satisfaction, for a moment at least, before my chronic perfectionism kicks in. Sure, it works as intended but is truly done or can we make it better? …
Now, I know I am not a dummy, and I’m gonna assume you are not a dummy either. However, we all have different learning styles, and sometimes it takes a while for a new concept to “click”, and it can often make you wonder if you’re a dummy until it does. Or maybe that’s just me.
Recursion is one of those concepts that I used to find myself relearning every time I didn’t use it for a while. …
As some of you know, I’m on the market — looking for my next opportunity in web development. This means I’m spending my days at my desk doing one of two things:
*And also to add more skills to my resume and keep growing as a developer.
The list of things I want to learn grows every day, but I decided to give priority to JavaScript frameworks, algorithms, and AWS certification. My time at the Flatiron School gave me a lot of hands-on experience, and I loved learning enough to build something and then jumping in to build it. …
About