Megan Tiu

Megan Tiu

My tw2 32px My li2 Email

Your Own Personal .gitignore

August 21, 2016

Have you been wanting a way to create and keep new files in a git repo without checking them into git, and also not adding them to your .gitignore? Maybe you're working on a large team and want to impose on them neither your config files nor another line in the project's .gitignore? Well, you're in luck.

It's the git exclude!

Read more...

Files Created by Rails Generators

July 17, 2016

Generators are one of Rails' greatest features and one of the reasons it's so easy to get up and running with new Rails projects. Unfortunately, they tend to be accompanied by a lot of extra files you may or may not need. Whenever I'm using generators, I like to know exactly what I'm getting into file-wise, ideally via a reference that lists what files I can expect to have when running them. Yes, this exists in the form of man pages for each individual generator, but I prefer to be able to see many at once, comparing my options. I've yet to see this kind of resource. Until now.

For this guide, I'll be using a Rails 5.0 default application with no additional gems and no modifications to the generator system. If you're looking to modify the content created by the generators, Thoughtbot has a helpful blog post on that here. Railsguides.net also has a great post on generator usage and getting more out of the basic generators here. With that said...

Read more...

Apprenticeship Patterns: Lessons Learned

June 26, 2016

For the past six months, I've been part of a book club of developing developers reading Apprenticeship Patterns by Dave Hoover and Adewale Oshineye. We took a leisurely pace to truly understand and appreciate all the different lessons this book provides and I'm so glad we did. The book is structured in patterns: reusable solutions to common problems in one's career. While the Record What You Learn and Share What You Learn patterns have been massively influential for me in an immediate and concrete way (they're why I started this blog), I've found more useful advice in some of the book's overall themes.

Read more...

Upgrading Rails Doesn't Have to Be Painful

June 19, 2016

Rails 5 is nearly here! But you're dreading the upgrade process. Fear no more, friend: this guide has you covered. This year, I was fortunate enough to attend RailsConf in Kansas City, including the Keep Rails Upgraded workshop by Derek Prior, Caleb Thompson, and Richard Schneeman. As someone relatively new to Rails, they swiftly took me from never having upgraded Rails versions to feeling totally comfortable updating my apps in production.

Depending on the size of your app, this isn't intended to be a particularly short process. You'll be reading gem changelogs, wrestling with deprecation warnings, and waiting patiently for your Rubygems dependencies to resolve. But it's really not as hard as it seems!

Read more...

The Ins and Outs of PUT and PATCH

June 12, 2016

The world of HTTP is vast! GET and POST are by far the most popular type of requests, but they'll only get you so far. Until recently, the only instances I'd ever really needed to use methods other than GET and POST were server-side while consuming others' APIs; this never proved to be an issue. Lately, however, I've been making more API requests from my own client-side apps, which has brought along some unique challenges. What if you need to update a resource? Meet PUT and PATCH.

Read more...

Adventures of a One-Woman Development Team

June 5, 2016

At time of writing, I've been studying and practicing web development for roughly a year. In that time, I've gone from nervous, questioning, and anxious about my future to firmly planted in a career I love. In June of last year, I introduced myself to modern HTML & CSS (the skills I learned as a 10-year-old weren't going to cut it in a professional setting). In July, I started writing Ruby. I went through a web dev bootcamp. I learned to use Rails, Javascript, git. I learned to work on a team, debug my code, and explore the vast world of programming. In September, I started my first full-time development job.

Nine months later, I'm my company's technical lead. I'm also the most junior person there. I'm also the only developer, period. A team of one.

Read more...

Ruby's Enumerable Module and You

May 29, 2016

When was the last time you explored Ruby's Enumerable module?

Want to get more control over your data? Of course you do. Thankfully, you're in luck! Enumerable is included anywhere you can use an #each method. Arrays? Yup. Hashes? You bet. You can even use it in your own custom classes. Discovering this module was a big level-up for me–all of a sudden, I could accomplish more in fewer lines of code. I could read my data-concerned code easier. I could lift a horse with my newfound power! (Okay, that last one's probably not true. But still, the Enumerable module is pretty great.)

Here are a few of my favorite ways to use the Enumerable module:

Read more...

Getting and Setting Cookies in Javascript the Fun and Easy Way

May 22, 2016

Here we are: my first installment for the #BlogBuddies blog with my buddy Loren! My goal for this series, (as outlined here), is to share what I'm learning on a weekly basis with others--be it lessons in teamwork, new workflow techniques, or fun little hacks--and to have a record of my progress. This week, I worked with cookies for the first time.

Until I started work on one of our company's new Javascript-based projects, I had never really thought about, much less used, cookies. I'd always assumed (mostly out of ignorance), that cookies would be difficult to use effectively. This week, I was very happy to be proved wrong.

Read more...

#BlogBuddies

May 15, 2016

Learning is fun. But when you learn a lot at once, it's hard to keep track of all the things you learn in a given time.

I've had this blog for a while now, yet at a whopping count of two posts, I clearly haven't been utilizing it properly. Thanks to some inspiration by some friends and our book club, this changes now!

Read more...