So.. I want to get back into writing, by writing I mean blogging, and by blogging I mean sharing things related to code.

Things I’ve learned, Things I’ve built, etc…

Why, you might ask? Well firstly, I think it’s important in any sort of pursuit to be able to share your ideas and present what you’ve worked on. I think blogging is good practice for that.

I think it’s important to study, practice whatever you’re pursuing, but it’s just as important to be a part of a community. I don’t think any good, meaningful thing is going to come out of me being alone in my room coding all day. …


Okay, for this blog post I want to talk about NPM. How does it work? How does it relate to package.json, package-lock.json, and the node_modules directory?

I will also be going over “what is a package and what is a module?” Also, we will create our own very simple npm package and publish it.

Introduction

I’ve been working with Javascript libraries like React, and Vue for almost 2 years now — also working with NodeJS for APIs. I understand a little bit about installing packages and importing them into my projects. Being able to import a library of code and plug & play makes building applications so much easier and quicker. …


I graduated from a coding Bootcamp (Flatiron School) ~4 months ago and have been applying to jobs.

Last week, I got an offer for an unpaid internship at a very early stage startup. Despite many of the posts I read on Reddit advising against taking an unpaid internship, I decided to take the position. I wanted to share why I decided it might be a good idea for me based on my professional experience and the current times. Also, the internship lasts for a little over four months.

Reasons why you shouldn’t take an unpaid internship

  1. Unpaid internships don’t lead to jobs according to “data”.
Image for post
Image for post

Looking at this chart, it doesn’t really look like unpaid internships lead to job offers. Also, apparently, the data shows that unpaid interns actually make less money when they do get jobs than people who never had…


Image for post
Image for post
OAuth 2!

Background

I spent a decent amount of time trying to get OAuth working for a writing application that integrates Google Drive API. I ran into a bunch of problems with CORS and decided to do some research about what exactly CORS is. I also learned a lot about how to properly make a request to an OAuth server from a browser. If you’ve been struggling with CORS and OAuth 2.0, you might find some of this stuff helpful.

Same Origin Policy

Really quick, before we go into why we need CORS, we need to know about the Same Origin Policy.

ALL requests made by the browser are made using the Same Origin Policy, (except for a few methods that we’ll cover later). …


Image for post
Image for post
Immer!

Alright, this week I just want to share Immer’s produce function and how we can use it to make our Redux reducer’s look cleaner.

If you’ve worked with Redux, I’m sure you’ve seen this sort of syntax in your reducer…

When we want to modify a nested property, we have to use the spread operator to construct the same state, and then once we get to the nested property, in this case, players, we can make whatever change we need.

Wouldn’t it be much nicer if we can just modify the state directly like so?

Yes, it would, but we can’t do this sort of thing because React and Redux use Immutable data types. Basically, immutable data is data that can’t be changed or mutated. So any time we want to change data in React, we simply assign it an entirely new object. …


Image for post
Image for post
1337

Just some tips and pointers for working with variable references inside Ruby functions, blocks.

Background

I’ve been studying for technical interviews: doing a bunch of problems on Leetcode, and anytime I needed to use recursion for DFS or any other problems, I got really confused and ran into a lot of errors.

More specifically, when I needed to pass in variables into recursive functions and update some sort of counter variable.

There’s one problem I’m sure you guys have seen if you’ve been practicing Leetcode: the number of islands problem. Say on top of keeping track of the number of islands, I wanted to keep track of exactly how much land mass there was. …


Image for post
Image for post
BEM!

Is your CSS for your React project jumbled into one index.css file with no structure? Do you have a bunch of old CSS modifiers and aren’t sure if they’re being used?

In other words, is your CSS a mess and you need a way of organizing CSS for React? Look no further! Here is my system for organizing React CSS.

I’m not really an expert, but after watching some Youtube videos of other experienced React developers and reading up on BEM, these are a few tips I’ve picked up.

Always use classNames

Firstly, use classNames to modify ALL your components instead of ids because of the nature of React. …


Image for post
Image for post
Rails!

When I was learning about developing Rails applications, I learned that we should keep our application’s secret keys in the application’s ‘environment variables’. Environment variables are not tracked by Git, therefore they won’t be committed to public repositories. As a result, our keys are kept safe and our applications are secure.

I’ve worked on many Rails applications now, and each time I’ve worked with environment variables, I felt a little lost. I knew it was secure to store them there, but I wasn’t quite sure how to set environment variables, where environment variables exist, and what they really are. I had read on some quick google searches that environment variables exist within the local system and are available across all applications. …


Image for post
Image for post
Console-Poker: A Web Application

This week, I want to share the project I’ve been working on for the last month! It’s still a work in progress, but I think the application is at a presentable stage where I can share it.
Note: The UI needs a lot of work and any UI engineers that are interested are welcomed to reach out!

Ideation for Console-Poker

Console-Poker is my most recent project that I’m very proud of. I built this project because my friends and I enjoy playing poker when we hang out, and what better time to create a virtual game then now during COVID! I knew there are many poker games out there so I wanted to create my own take by creating a UI where players play poker using a terminal, similar to how coders execute commands in a terminal — I personally find working with a terminal very appealing, and I think with the popularity of coding/coders in media like Mr. …


Image for post
Image for post
GitHub Octocat!

For the past year or so, I’ve been using GitHub regularly. I felt comfortable setting up my directory and also using commands like git add ., git commit -m, and git push. However, I got lost pretty quickly when I need to do anything besides commit and push a new change to GitHub. One example would be when I mess up irrevocably and I need to reset to an older commit. I see things like ‘branches’ and ‘HEAD is disconnected’ and I start to worry. …

About

Arthur Song

Flatiron School Graduate, React.js, NodeJS, Ruby on Rails Developer, Learning Enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store