• Your Life in Weeks

    I recently watched a TED talk called Inside the mind of a master procrastinator by Wait But Why author Tim Urban. In the talk, Urban, a full-time blogger, humorously relates his lifelong struggle with procrastination to the audience. But under the light hearted shell, Urban addresses a much heavier point. He shows an image of a grid made up of small squares and asks the audience what they think it represents. It turns out to be the number of weeks in the life of a 90 year old person, with each square representing one week.

    Keep reading...
  • Method Stubbing in RSpec

    Testing is a controversial topic. Some people love it, some hate it. Should one use TDD to build their product? Should one test at all? Which framework is the best? This post is going to sidestep these controversies. I’m assuming that you recognize the merits of testing, TDD when it’s convenient and makes sense, and have chosen to use RSpec. With that out of the way…

    Keep reading...
  • Six Months at Sturdy

    On October 2nd, 2015, I left my job at an exciting startup to work full time at Sturdy. Lately, I’ve been reflecting on the reasons for starting Sturdy and how it’s been going for the past few months.

    Keep reading...
  • This and That

    Coming to Javascript from languages like Ruby can be difficult. As Ruby developers, we get a lot for free. Things like the Enumerable module and symbol to proc can spoil us Ruby developers. One especially confusing language feature that changes from Ruby to Javascript is the concept of this.

    Keep reading...
  • Source Location

    Ruby gives programmers some incredibly helpful tools to help debug and understand their code. One of these is tools is the #source_location method. Defined in the Method class, #source_location will point you to the file in which a given method is defined.

    Keep reading...
  • Guard Clauses

    Methods can become difficult to read when nested conditionals are introduced. Even in simple examples like the one below, determining under what conditions the method gets executed is slightly ambiguous. The sideways pyramid shape that the code is taking on is adding unnecessary burden to your eyes as you scan the screen.

    Keep reading...
  • Finding Deeply Nested Hash Keys

    I often find myself wanting to find hash keys that are nested within a given hash. This is common when getting API responses, as they usually give back a ton of information. The way to handle these giant hashes usually involves manually traversing each level:

    Keep reading...
  • Tracking Streaks on Your ActiveRecord Models

    Progress can be hard to measure with anything you do. That’s why having a process for becoming better at something is so helpful. You don’t always see results right away, but if you practice enough, things will start coming together. Being able to keep yourself accountable for sticking to a process is much easier when you can easily measure it.

    Keep reading...
  • Understanding Ruby's 'inject' Method

    As I have been leveling up my Ruby skills and knowledge, I’ve discovered that there are many concepts that I still don’t have a strong grasp on. One example is the inject instance method in the Enumerable module.

    Keep reading...
  • Foreman

    In my last post, I went through the process of setting up Sidekiq to run background jobs in my app. In order to run background processes, separate processes need to be started. Spinning up these separate processes can be tedious, manually starting each one. It’s no longer as simple as running rails s.

    Keep reading...
  • Background Jobs with Sidekiq

    There comes a point where the application you’re building needs to run fast. People do not like waiting for screens to load. They need instant gratification. Not to worry, because background jobs are meant to take care of your computationally complex tasks so you can go on delighting your users.

    Keep reading...
  • Autosave with jQuery

    A few weeks ago, I started building this Rails app to help me become a better writer. It’s a simple app that is meant to motivate me to write every day by keeping track of streaks and awards points based on number of words written.

    Keep reading...
  • My First Year as a College Dropout

    Over the past nine months, I’ve had more than enough time to reflect on my choice to drop out of college. Living truly alone for the first time, and setting out to learn how to build products at Starter School has given me perspective on what is valuable about college - and what isn’t.

    Keep reading...
  • Staying Committed

    Habits are powerful. They define what we do every day. They’re hard to form deliberately and incredibly hard to break. Back in September, I read a great blog post by Ryan Seys in which he described his habit of committing to Github every day, and how that helped him improve his development skills. His article inspired me to try the same.

    Keep reading...
  • Rails Automatic Loading

    After too long of a break, I’m getting back into Rebuilding Rails. In chapter 3, Noah explains how Rails uses automatic loading to make our lives as developers easier.If you’ve ever worked with Rails before, you know that you can refer to a class, like a controller, from almost anywhere in Rails, and didn’t have to require the new controller file anywhere. How does this work?

    Keep reading...
  • Finding a Successful Process

    Starter School is in its third and final phase. This last three month sprint is the culmination of a grand experiment to see if we can learn how to build and ship a successful product in nine months. More importantly, the folks at Starter School are trying to teach us a successful process for building products, since our current ones aren’t guaranteed to succeed.

    Keep reading...
  • Javascript is Weird

    When you come to Javascript from the Ruby world, things can be pretty confusing and strange. What are all these curly braces and semi-colons for? Why are there some functions with no names? These are a few of the questions that went through my mind when I first encountered Javascript. Although Javascript is insanely powerful with things like jQuery and AngularJS, it’s a pretty tough language to get used to compared to Ruby.

    Keep reading...
  • Your First Controller

    In chapter 2 of Rebuilding Rails, you go through the process of routing requests through a controller as opposed to returning the same response to every request. Here are some of the important parts:

    Keep reading...
  • Rebuilding Rails

    Going into the design semester at Starter School, I knew I would have to keep my Ruby and Rails skills sharp on my own. The best way to do this is definitely to just build more apps, but I also wanted to get a better understanding of what’s going on under the hood of Rails. Luckily, we have some great mentors at Starter School, one of which recommended me a book called Rebuilding Rails(Thanks Alex). In the book, Noah Gibbs takes you through constructing your own Ruby web framework, highlighting parallels to Rails along the way. Here are some cool things I took away from the first chapter:

    Keep reading...
  • Starter School: Week 13

    This week, the focus of class was on responsive design and learning the basic principles of good interface design.

    Keep reading...
  • Starter School: Week 12

    The start of the second semester of Starter School is finally here. The next three months will be focused on design and front-end development. We’re now entering uncharted territory as far as programming bootcamps go: a full front-end curriculum to complement the back-end concepts that we have been learning since late September. It was a short week of class, but we hit the ground running with some more advanced CSS.

    Keep reading...
  • Starter School: End of the first semester

    The last few weeks of the semester were packed with new stuff, and I’ve been getting a bit behind on writing about it, so this post is going to be a long one.

    Keep reading...
  • Starter School: Week 8

    User authentication

    One important aspect of application development that often gets overlooked is user authentication. Of the several ways to implement it, the question of password encryption comes into play. Bcrypt is a cryptographic standard for password encryption, and is the most recommended. Luckily, you don’t have to implement Bcrypt yourself, there’s a gem for it. Add gem 'bcrypt-ruby' anywhere in your Gemfile to get started.

    Keep reading...
  • Starter School: Week 7

    Domain Modeling

    Now that we’re in the latter half of the semester, we’re dealing less with the boilerplate CRUD of web applications and more on the logic that powers the interesting parts of the app: the models. To get us to think about this, Jeff had us do an exercise called domain modeling. Creating a domain model involves sketching out on paper or a whiteboard how the different models in your app connect to one another. It’s actually incredibly helpful to draw out a visual representation of how models are related without wading into the code. It allows for a high level perspective of the app that can make you realize the fundamental flaws in it’s design.

    Keep reading...
  • Starter School: Week 6

    We’re now officially in the second half of the web dev semester of Starter School. According to Jeff, we’re almost done learning the basics that we need to build out a working prototype of our apps.

    Keep reading...
  • Starter School: Weeks 4 and 5

    Over the last few weeks, class has been moving really fast. We’ve gone into Rails quite a bit, learning things like basic CRUD functionality and database queries. While these past couple weeks of drilling the basics of Rails in class has been really helpful, the critical learning experiences have happened at hackathons. Two weeks ago, a couple of other Starter School students and I went to a sponsored hackathon, and this weekend, Starter League held one at 1871.

    Keep reading...
  • Starter School: Week 3

    After this week, our time dealing solely with Ruby is over for the rest of the semester. It’s Rails from here on out. To finish off our pure Ruby curriculum, we went through a few concepts that definitely filled some holes in my knowledge.

    Keep reading...
  • Starter School: Week 2

    The pace of class is accelerating really fast now. We started diving into Ruby this past week, and I have learned more in that short time period than I did in several months of self-study. We had a couple interesting challenges to complete over the weekend, the first of which I’ll talk about in this post.

    Keep reading...
  • Starter School: Week 1

    After months of anticipation, last week finally marked the beginning of Starter School.

    Keep reading...
  • Project Euler: Problem #3

    Here’s problem 3:

    Keep reading...
  • Adventures in Emacs

    For the past nine months that I have been learning to program, I have used Sublime Text for all of my coding needs. It is a great editor and extremely friendly to beginners. I have come to love it’s slick UI and ease of use.

    Keep reading...
  • Project Euler: Problem #2

    Here’s the second problem from Project Euler:

    Keep reading...
  • Project Euler: Problem #1

    Although I’ve been learning Ruby and Rails for the past several months, I still feel like I need a better understanding of programming with respect to the more algorithmic side of things. While searching for resources last night, I came across Project Euler. Project Euler is a tool used to sharpen math skills through writing computer programs. In an effort to become really good at programming in Ruby, I’m going to try to solve a problem a week, and write about my thinking process behind the solution.

    Keep reading...
  • Increasing Terminal Efficiency with Bash Aliases

    There’s tons of stuff out there that can improve your programming efficiency, but one of the easiest and simplest ways to do this is using Bash aliases. A Bash alias is essentially a keyboard shortcut, an abbreviation that allows the user to avoid typing long command line sequences. Personally, I use aliases for my git workflow. Although this isn’t the most time consuming process in the first place, aliases cut the time from a little under a minute, to a matter of seconds.

    Keep reading...
  • init

    Since this is my first blog, I suppose I should introduce myself. I’m Garrett Martin - a nineteen year old computer science student from Pelham, New York. I created this blog in an attempt to contribute to the programming community by writing what I learn. It also wouldn’t hurt to improve my writing skills along the way.

    Keep reading...

subscribe via RSS