Monday, January 23, 2017

GIT in 5 Minutes from the top down

  • You have directories and files on your computer which make up your file system
  • GIT is a version control system that allows you to manage changes to any part of that file system over time
  • A working tree is any directory on your computer that has a GIT repository
  • A repository is a collection of commits
  • A commit is a type of GIT object that represents a snapshot of a working tree
  • A snapshot of a working tree is represented by a GIT tree object
  • A tree object is a tree of blobs
  • The three fundamental types of GIT objects are commit, tree, and blob
  • blobs hold file contents and thus the structure of blob trees reflect the structure of the working tree
    • blobs track file size and content. Two files with the same content will be represented by the same blob ID by GIT even if they're on two different machines. Why? Because they have the same content
  • Fundamentally, using GIT means manipulating the shape of blob trees
In summary, since commits point to blob trees which are the snapshot of your working tree. Manipulating different commits means manipulating different snapshots of your working tree. If you know how to do this effectively for a project, you have a great deal of power over what changes made a one point in the project to the changes made at a different point.

But what about stuff like HEAD, branches, tags, rebase, merge ... etc. Ok, ok. One more minute.
  • A HEAD points to the currently checked out commit
    • If you checked out a branch, it's tracking that branch
    • If you checkout out a commit, it's not tracking new commits. Called a "detached head" because it's not tracking a branch so it's not moving with the branch
  • branches and tags are just named commits
    • a branch (branch of development) represents the first commit in a tree of commits and tracks new commits made on top of that tree
    • a tag represents a specific commit and does not move
  • merge and rebase are different ways of bringing together different snapshots of your working tree together
    • merge tells git to "just bring shit from main branch A into feature branch B, then create a single new merge commit that represents the new working tree that resulted in the changes you made"
    • rebase tells git to "bring each commit from main branch A, let me decide if I want to keep them, and then bring the ones I want to keep into branch B one by one as if I made the changes on branch B"

Thursday, January 12, 2017

Slightly more advanced sublime shortcuts

There are more specialized text manipulation shortcuts that can help you make the changes you want more quickly than relying on basic selection shortcuts:

Create a macro
CTRL + Q to begin recording, CTRL + Q to stop recording, and CTRL + SHIFT + Q to execute the macro.

This is super useful when you need to make the same change across a number of different files.

Shift lines up and down
CMD + CTRL + UP and CMD + CTRL + DOWN

I have to move lines of code around very often and this is a significantly more efficient (and less error prone) way of doing it then cutting the line and then pasting it. You can also shift multiple selected lines!

Repeat the last command
CMD + Y

If you need to repeat commands that take way too many keys like CTRL + SHIFT + Q (remember what that does?) or CMD + CTRL + DOWN, you can just type this to repeat it. Really handy!

In the next post, I'll be covering basic search shortcuts.

How do inactive credit cards affect your credit score?

"One of the most important factors in your credit score is the credit utilization ratio (often referred to as the debt-to-credit ratio). This measures the existing balance on your cards relative to your total spending limit, and reporting agencies use it to assess how well you handle credit.

That said, there is one way that maintaining a zero balance could hurt your score. Card issuers have been known to cancel cards after sustained inactivity, and if your account is closed, then you lose that portion of your total spending limit."

- http://thepointsguy.com/2016/02/should-i-use-credit-cards-monthly/

"If you’re holding onto a credit line that you’re not using, your credit card company would rather take it away from you and give it to another customer that will."

"Although the CARD Act of 2009 states that creditors must provide customers with 45 days notice of major changes to the terms of their accounts, courts have decided that a card cancellation caused by inactivity doesn’t count as one of those major changes."

- https://www.nerdwallet.com/blog/credit-cards/credit-card-cancelled-due-inactivity/


"Utilization contributes toward the amounts-owed portion of your FICO score, a scoring model commonly used by lenders. The amounts-owed factor counts for 30 percent of your score."

"The score wants to see some kind of activity"

- http://www.bankrate.com/finance/credit-cards/does-card-inactivity-hurt-credit-score.aspx

In summary:

  • You must use credit cards and pay them off as agreed (making at least minimum payments) to build credit score. Now
  • Credit utilization accounts for at least 30% of your FICO score. The lower the better - but to a point!
    • No credit activity for a some cards can lead to card cancelation, which increases your utilization.
    • No credit activity at all can hurt because zero activity = unpredictable = high risk.
So, not having any credit card activity is not ideal. If you have many cards and you want to stop using them, avoiding them permanently will cause them to be canceled by the issuer. Keep the ones you want active just by using them once every few months. As for the ones you don't want, cancel them after zeroing out your balance to avoid a hit to your utilization ratio. In general, having a long and positive credit history (healthy ratio) is more important than how much total credit you have at any given moment. 

Sunday, January 8, 2017

Trying a new architecture for managing my basic finances

Back when I was a student with almost no money and no credit cards, managing my finances was simple. The only recurring expense I had was my tuition and room and board and my parents took care of that once a year. I didn't own any credit cards so all the money I had to use was whatever I had in my bank account from my on-campus jobs. 

As far as I was concerned, the financial architecture of my life looked like this:




Sometimes I wanted to buy stuff on Amazon.com and sometimes I would go with my friends out to the city to eat at a restaurant. I had no bills to worry about month to month. Since I didn't have credit cards (zero debt), I knew exactly how much money I had just by looking at my checking account. It was very, very low stress. 

Nowadays, things are a bit more complicated. I have lots of bills to pay, I use a number of services that charge me periodically, and I have multiple credit cards.

My financial architecture now looks like this:



My parents are no longer handling my fixed expenses and the fixed expenses that I deal with now exist on different payment cycles. As a college student, there was one giant payment in the beginning of the school year that pretty much covered my ass for the whole year (food, living, club activities). Now, there's a bunch of individual fixed expenses that charge monthly - and at different times of the month!

I can no longer just look at my checking account and know how much money I have to spend each month because:
  • I pay for services using my credit card and credit card balances aren't due until the following month. So if I spend $1000 right now on a plasma television, I won't see that amount reflected on my account this month since it goes towards what's due the next month. 
  • I pay for services using multiple credit cards, which means I can't know how much I have to spend until I analyze the statements of all of my credit cards!
  • Some services (like my building maintenance fee) are fixed and recurring but can't be paid using a credit card! And at the same time, they bill at the middle of the month. This complicate matters even more. 
I don't like this at all. It's stressful and on more than one occasion it's caused me to overdraw my account because I don't know how much I actually have to spend. Sure, I can just start tallying how much I spend every single day but I really don't want to do daily, manual accounting.

Here's the new system I'm attempting to move towards: 



In this system, I only use a single credit card for all of my fixed, monthly payments. The benefit of using a credit card for these services is that I don't have to worry about when in the month they bill me. It could be the 2nd. Mid-month. 23rd. It doesn't matter. All I need to be concerned about is:
  • When my credit card payment is due
  • I have enough money to cover that payment
The credit card is essentially an interface for payment between me and all the monthly services I have to pay for! Also, you can continue building your credit and get cash back rewards for using the card.

The second key feature is switching my primary and secondary checking accounts. The secondary checking is now responsible for all outbound payments - to credit cards and fixed services that don't use credit cards like my building maintenance. The key benefit of this is that it gives me complete control over when I want to deduct the expenses from my primary account. If I want to do it at the beginning of the month, I can set up a system to move X amount of money over. 

With these two changes, I have full control over when to pay and when to get charged. Sure, they need to be synchronized but having to synchronize two dates is a vast improvement over having to synchronize N where N is the number of services AND credit cards. 

How to set up this system
  • Set up a fixed payment checking and fixed payment credit card
    • Create a second checking account if you don't already have one.
    • Choose a single credit card to pay for fixed expenses (it doesn't have to be all of them).
    • Update as many of your fixed cost, recurring services to draw from your credit card. 
    • Use your second checking to pay off your credit card and remaining services not on your credit card.
  • Sync schedules
    • Update credit card to charge balance at the end of the month. 
    • At the beginning of the month (or close to the date you're paid), move the money over to your fixed payment checking. 
Migrating

If you're migrating from a different system, it's easiest to pay off your total balance for all of your credit cards before adopting this new system. Once everything is set up and your cards are paid off for the current month, set up the scheduling for the next month!


Friday, January 6, 2017

How I currently manage my finances vs how I want to manage my finances

My current system is as follows:
  • Three credit cards
    • Discover One
    • AMEX Blue
    • Chase Amazon rewards
  • One debit card
    • Charles Schwab Bank
Subscription bills go to my discover card. I use AMEX for groceries and my Amazon card for all other purchases. My paycheck gets directly deposited into my Charles Schwab debit card and all credit card payments are drawn from the same checking account. I set a monthly budget for myself, but I have a hard time sticking to it.

The problem isn't that I have a lack of discipline. The problem is that this system is too fucking complex.  Monthly fixed expenses like entertainment subscriptions or phone bills get deducted at different times during month and credit card balances accumulated in the current month isn't due until the following month.

I can't simply look at a single balance and say, "can I afford to buy this thing I'm about to buy right now?".

In an excellent post by Ramit Sethi on automating your finances, he says
"Most people neglect one thing when automating: dates. If you set automatic transfers at weird times, it will inevitably necessitate more work, which will make you resent and eventually ignore your personal-finance infrastructure. For example, if your credit card is due on the 1st of the month, but you don’t get paid until the 15th, how does that work? If you don’t synchronize all your bills, you’ll have to pay things at different times and that will require you to reconcile accounts. Which you won’t do."
That's exactly what I've experienced! Because my bills were not synchronized, I felt like I could no longer trust the balance that was in my account to the point of ignoring it altogether.

Ramit offers some great advice for avoiding this problem: get your bills on the same schedule. Get paid on the 1st? Get all your bills paid at around that time automatically. There's a couple of problems (which he addresses) that makes this a bit tricky. First, not everyone gets paid on the 1st (or even once a month). I currently get paid twice a month - on the 6th and on the 22nd. Second, it's a lot of work to try to get companies / services to charge you on the date of your choosing and keeping that up to date as your income schedule changes.

I really like his idea, but I think we can we set up an even simpler system. One that is less dependent on when you get paid or charged.

The system I'm about to propose is based on the following key assumptions:

1. You're less likely to overspend if you know how much you can actually spend as early as possible. How much you can actually spend = (your income - fixed expenses). You can't budget if you don't know how much you're working with.
2. Simply knowing how much you can spend is not enough if your account balances do not accurately reflect it. For example, you may know that you're left with $356 after paying your fixed expenses every month. However, your expenses don't kick in on your account until long after you've received your paycheck. Looking at your bank account, it looks like you have a lot more to spend than you really do!
3. Trying to keep track of all the charges (the synchronization challenge Ramit refers to) in your head is really hard and will cause you to hate life.
4. Asking all the services you use to charge you on the same schedule is a lot of work and requires a great deal of effort and discipline to maintain.
5. Paying your bills for all the things you're charged for all at once is significantly better than splitting your payments because you have a bi-weekly paycheck schedule. Simple is good.

Ramit's system is based on the first three assumptions. You want to know how much you got to spend early, and you do that by calling companies and getting them to charge you as close to when you receive your paycheck.

I don't think it's a good idea to request every service you use to adhere to a specific schedule for several reasons. First, this may not always be possible. The universe does not revolve around you. What if one of those charges happens to be a monthly loan repayment for your friend who needs the money on the first of the month? Second, your income schedule may change. People change jobs all the time now. What happens then? Do you call every company again? Lastly, you have to do this for every new service you pay for. Just bought an ESPN subscription? Better go and make sure that they bill you on the 1st! That's going to get annoying real fast.

Ramit suggests a different system for people who get paid twice a month: split your payments. I really don't like this idea. My biggest problem with it is that it ties when you pay to when you get paid. You have to constantly re-evaluate the math every time either one changes. New service added? Oh, well does that get paid in the first or second pay check?

My proposal

  1. "Pay" all of your fixed charges on the first of the month by moving it to a separate checking account. 
  2. Update your charges to go on a single credit card and schedule your payments to be at the end of the month or anytime after you've received your total income for the month. 
What's great about #2 is that you can allow services to charge you anytime of the month. No need to manage when you need to pay them since that's taken care of by your credit card. With #1, you can reap all the benefits of having your bills charged on the first without having to actually reschedule any of your charges (thanks to #2). And if you don't have enough to pay it all upfront (because you get paid twice a month), splitting your charges in half is far easier this way than modifying payment schedules so that roughly half gets taken out.