Blog

thoughts and musings...

Backoff Strategy for Laravel Jobs

What are jobs? Background jobs are key to any seemingly fast application. They’re really useful for running tasks asynchronously so that your user isn’t waiting for some code to run that doesn’t directly impact their experience in the app. One small example of using a background job is when a user logs in to our app,... Read more

The Proxy Pattern in Laravel

Proxy is one of those words that makes you sound technically smart and it’s seen an increase in usage over the last 20 years according to Google Books Ngram Viewer. Well what does proxy even mean? Lets take a look in more detail. Proxy Pattern The word proxy often means something that replaces something else and... Read more

The Facade Pattern in Laravel

Next up on the structural pattern is the Facade pattern. Supposedly, it derives its name from the word facade, which (according to Google) means: the face of a building, especially the principal front that looks onto a street or open space. an outward appearance that is maintained to conceal a less pleasant or creditable reality. I’m... Read more

The Adapater Pattern in Laravel

Now that we’ve finished the creational patterns, we’re moving on to structural patterns. These patterns focus primarily on the composition of classes and objects in order to create a scaleable structure for the application. There are seven total patterns in this family and we’ll take a look one by one. First up: the Adapter pattern. Adapter... Read more

The Factory Pattern in Laravel

I took a little break this past week, but back on it for the last creational pattern. Well, there’s technically two more, but they’re very similar so I’m going to combine them into one post. Factory Pattern The factory pattern and the abstract factory patterns are similar in that they create objects like a factory by... Read more

The Singleton Pattern in Laravel

Alright, next up in the creational design patterns is the singleton pattern. Its pretty easy to remember this one. The singleton pattern is when a class has a single instance of itself. Meaning that whenver I want to use an instance of the class, I’m using the same instance. Singleton Pattern The implementation of the singleton... Read more

The Prototype Pattern in Laravel

I’m going to be talking about another creational pattern called the prototype pattern today. This should be pretty straight forward to implement in a lot of high-level languages and we’ll take a look at a common place we use it in Laravel. Prototype Pattern The prototype pattern is one of the more simple ones to understand.... Read more

The Builder Pattern in Laravel

Wow I should have waited another 10 days so I could have written a new blog post on the 1 year anniversary of not writing in my blog… jk. I also like how my last post was about trying to learn Python and now I’m talking about PHP. I guess a quick catch up of what... Read more

Rubyist's guide to Python

Ruby was my first programming language and I love it for the simplicity and the syntactic sugar. Python is another popular high-level language used a lot for its data crunching libraries. I wanted to take some time to compare the difference between the two and point out some differences between Ruby and Python. Version Managment Ruby... Read more

React: High Order Components

I started using React almost a year ago and ran into the concept of high order components (HOCs) a few months in. For a long time, whenever I came across any libaries that used HOCs, I cringed and just sorta figured out how to use it without a full understanding. But as I’ve written and used... Read more

Gulp: Fingerprinting Assets

The modern web browser does a lot of things behind the scenes to improve the user experience, like caching asset files on your local disk. In this way if we need to load them again, it just reuses those files instead of making a request to the server. As developers, we should know about caching because... Read more

Backbone to React: Learn.co's Track Nav

Last week, I attended a React meetup where I listened to three speakers (one from Pinterest, another from NPR, and the last from OpenTable) talk about their stories of migrating their web applications from Backbone.js to React.js. The day after, I was put on a project to reskin/rewrite a part of our site’s navigation header: the... Read more

Getting Wasted on 99 Bottles of OOP

Excuse the title of this post, but it’s beer week here in San Francisco and I’ve cracked open a bottle of beer from Deschutes Brewery. Oh yes, I also finished the first 4 chapters of 99 Bottles of OOP by Sandi Metz & Katrina Owen so just want to jot down a few things I learned.... Read more

A Hitchhiker's Guide to Open Source Contribution

Why do it? First of all, why even motivate myself to contribute to open source projects? I mean, as a professional developer, I write enough code as already right? Wrong - Donald Trump interrupting Hillary Clinton 50 times in a debate I like to think of it this way: if people didn’t spend anytime at all... Read more

Wrap the Fetch

Alright, here’s my promised post about the first library I published on npm. If you missed my post about how to publish a library to npm, check out the previous post here. Origin of wtfetch The library I published is called wtfetch short for “wrap the fetch”. Yeah I gotta work on my name creativity, but... Read more

Creating an NPM library with Webpack

I’m technically on vacation, but hey, it’s all good. It’s more relaxing to learn about programming related stuff instead of going on massive tours to Stonehenge. Anywho, I had a need to learn how to publish an NPM library so I figured I’d jot down the steps I took to get a library published. The library... Read more

More Authorization with Pundit

Ok the whole reason why I wrote my previous post on authorization with Pundit was so that I could talk about more advanced usages of Pundit in our application. The Learn app started as a student facing curriculum management system with very simple admin interfaces. The admin tasks included adding students to certain batches and deploying... Read more

Authorization with Pundit

In a Rails app, authorization can be implemented in many ways. You can roll out your own simple authorization by assigning a role number where role = 1 means regular user, role = 3 means admin, etc. The above implementation was how the Learn app originally had authorization, but since then, our product has grown a... Read more

Implementing Faraday Retry in Rails

Yesterday, I had the chance to tackle an interesting problem at work. We use a lot of 3rd party APIs ranging from Slack, Github, to Ambassador and one potential issue is that sometimes these services timeout for whatever reason (API is down or slow). A common way to address Timeout errors is to have a retry... Read more

Tips for Starting out on React

Ok, its been about half the month and I’ve made it through handful of React tutorials and I feel pretty comfortable using React as a client-side framework. What I wish I knew 15 days ago… As I made my way through some of the tutorials, I found that if someone told me to read them in... Read more

Basic React Project Configuration

I made it through the basic React-Rails tutorial and read through some documentation on the Facebook React page. Naturally, feeling pretty good about myself, I charged ahead to make a simple ToDo list using React.js. I mean super simple as in no data persistence, no styling, no fancy animations. A few hours later, I still haven’t... Read more

React-ion May

I decided to dedicate the month of May to studying the new hotness that is React.js. A lot of people are excited about it. I’ve heard good things about it. I want to learn it to an extent that I’ll be able to make intelligent decisions on why it should be used on a project or... Read more

New Blog

This has been on the top of my Trello board’s to-do list, but I finally got a new blog up and running. Since 3 months ago, I decided to discontinue my Limitless blog and move off of Wordpress. It was just a lot of unneccessary overhead and I also built the theme for that site when... Read more

JS: Copy to Clipboard Button

A while ago (as in a month) I was doing a code challenge to create a bitly clone. One of the features I wanted to include on my website was the ability to press a button and have the shortened URL copied to your computer’s clipboard. I thought “Easy, no problem. Just have to use JavaScript... Read more

SE Asia: Getting Scammed

South East Asia is a super popular spot for travelers; both short-term vacationers and long-term backpackers. As tourists come and go through these countries there are many tourist traps set by locals to squeeze as much money out of you as possible. Here are a few that we experienced personally or were told by other travelers... Read more

Thailand: Scuba Edition

I’ve been wanting to get my open water scuba certification for a while, but never committed the time or money to do it. Then impulsively, I hopped on to a SE Asia trip with two of my college friends and soon-to-be doctors. As part of the trip, we spent 4 days getting our open water scuba certification... Read more

JQuery UI: Submitting a Sortable Widget

JQuery UI has a great widget called Sortable, where you can drag and drop items in place to… you guessed it, it sorts the items. This is great and all, but one of the reasons you may want to have this interactive UI is to reorder some list the user owns. In this post, we’ll take... Read more

Hello, my name is...

If you’ve ever worked on a project with me, you know that I love aliasing and renaming things so that code is more legible. One of the latest discoveries I had was that you can alias join tables so your code makes more sense when you read it out loud. Scenario Let’s say that I’m creating... Read more

D3.js Basics

D3.js is something I’ve been meaning to pick up and learn for a while. In my long flight and train rides, I’ve had time to go through and play around with some of its powerful features. In this blog post, I’ll just cover the very basic concepts of D3; selectors, modification of DOM elements, and data joins.... Read more

Flatiron: Week 12 & Final Thoughts

Ruby-007 at Flatiron School is now in the books and what an amazing journey it’s been! For this last Flatiron theme post, I wanted to do a really quick recap of the happenings on week 12 and wrap it up with final thoughts. Week 12 Happenings Science Fair - The “Science Fair” is what we, at Flatiron School,... Read more

JS: Carousel

Flatiron School ended last Friday and now most of my classmates and I are in a flurry of interviews. So far I’ve found that there’s been a lot of JavaScript related questions so I figured I would practice a little bit on JSFiddle. I stumbled through pseudo-coding a carousel in a recent interview and got curious on... Read more

Flatiron: Week 10 & Week 11

Whoa the last 2 weeks have been crazy! It was the span of our 2nd “project mode” time so my group and I have been spending countless hours hacking away to make an awesome app. I picked out a few of the guys I’ve really gotten to know well and our team chemistry was off the charts.... Read more

Flatiron Connection

This is a project I started back in week 4 or 5 of the semester, but never got around to finishing it. I started the app on Sinatra, but in 1 1/2 days, I converted the app to Rails, added some more functionality and got it up on Heroku. The basic feature of this app is... Read more

Flatiron: Week 9

Another unfortunate event happened this weekend right after me and bunch of classmates successfully participated in “Escape the room”. I was at a cafe studying with 3 other classmates when I accidentally dumped a cup of hot tea onto the keyboard of my laptop. I rushed it to the Apple Store as if I was taking... Read more

©2018 All rights reserved. Powered by Jekyll with dotX theme.