Contract Work

Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

Saturday, May 31, 2014

Interesting Reads 5/24 - 5/30

There's a whole boatload of good stuff this week! First, There are links to three more talks from RailsConf. Then another talk about leveling up. After that a few interesting blog posts. Finally, agood explanation of dotfiles.

Enjoy!


Sean Marcia is awesome and this is his great talk about Bees and saving the world: http://www.confreaks.com/videos/3318-railsconf-saving-the-world-literally-with-ruby-on-rails

Harking back to my management days a bit, this is a good talk about decision making and team working in tech: http://www.confreaks.com/videos/3487-railsconf-workshop-teamwork-ain-t-always-easy

Okay, I think I've only made it through 5 databases so far but interesting overviews: http://www.confreaks.com/videos/3374-railsconf-an-ode-to-17-databases-in-33-minutes

Another talk, but not from RailsConf, about taking your engineering role to the next level: https://www.youtube.com/watch?v=lgxEmiMJVq4

Information anxiety and how to parse through what you need/want to learn: http://blog.codinghorror.com/keeping-up-and-just-in-time-learning/

Great post on mentorship: https://medium.com/theli-st-medium/have-some-coffee-9e468d958e77

Interesting post on coding principles every engineer should know. Do you agree? Which would you add?: https://medium.com/on-coding/coding-principles-every-engineer-should-know-b946b48cc946

Lastly, this week I had to set up my first new computer for development. A friend passed this along to me. It's a great step-through of dot files which, I think, seem super intimidating, but aren't IRL: http://code.tutsplus.com/tutorials/setting-up-a-mac-dev-machine-from-zero-to-hero-with-dotfiles--net-35449

Monday, May 12, 2014

Setting up Aliases


For months and months I’ve heard people talk about setting up aliases and profiles and all these custom configs for their computers. I’ve done some basic googling but have stayed away from setting things up because I hadn’t found any simple, easy posts and I had this vision that this whole “set up” thing was super complicated. Guess what? It’s actually ridiculously simple. This is what I get for being too embarrassed to ask about something for an extended period of time.

What are aliases? Aliases are basically shortcuts for things you type all the time. The same way that hotkeys work to open up programs and execute certain actions you find yourself constantly using, aliases do that for your terminal.

The best place to start is to think about what you type all the time. For me, I type “git status” over a dozen times a day, so that was aliased to gs. Chris suggested that I set up an alias to open my bash_profile file so that I can quickly add more aliases as I discover what I type the most. As I mentioned, doing this is super easy.

1. Open up your bash_profile file
2. Set up your aliases by typing alias gs=“git status”

As you see, the left of the = is what you want the shortcut to be and the right of it is what the shortcut stands for. Once you’re got all your aliases in, quit terminal and reopen it to start using them.

Besides aliases, I also learned from JP about using homebrew more effectively. Homebrew is a package manager and with homebrew you can add different packages including git bash completion which allows you to tab to complete things like git branch names and more.

The final piece of this setup is naming your computer. Apparently this is a thing. I’ve got my Disney princess naming convention for my servers so now I need one for my computer(s). I’ve decided on 80’s cartoons starting with the very-applicable “penny”. I look forward to naming future computers Brain, Jem, and, I’m sure, a number of CareBears.

Here's a good article for additional reading on setting up git aliases: http://robots.thoughtbot.com/streamline-your-git-workflow-with-aliases

Tuesday, March 18, 2014

So Many Random Learnings

I love learning and in the past few weeks, I've learned so much!! In lieu of a more organized post on this stuff, here’s a random smattering of what I’ve learned the last few weeks.

Ls –lM lists everything in list form
Git rebase –i sha is what you use in order to squash commits

Git rebase master… I’m still learning the process and exactly how to troubleshoot this but it seems standard in worksflows that require pull requests and it’s pretty interesting to solve merge conflicts.

Debugging (with capybara): insert a save_and_open_page to see what page/path opens

Alfred workflows are amazing. I’m trying to train myself to use my mouse less. My wonderful mentor suggested that instead of going cold turkey on the mouse, I should start by getting good at just a few things. So, I’m starting with Alfred workflows and trying to get better at not using my mouse within my text editor (sublime).

Alfred workflows that I have set up include spotify, dash, and being able to search for any file or folder on my computer. I’ve got the git workflow partially set up.

In Sublime text, one of the most useful things I’ve learned recently is CMD + . will switch back and forth between the test file and file being tested. CMD T allows you to type to open a file. Just to name a few.
Option and highlight lets you highlight the first letter of each line


Git commit (without –m, etc.) will open your text editor so you can do the commit message there, save it, close it and it’ll bring you back to the command line and finish the commit
Git checkout – brings you back to the last branch you were on
Git rebase –i HEAD ~1 rolls back 1 commit (~2 rolls back 2 commits)

From the command line putting touch and then the path with the filename at the end will create that file

When squashing commits (which means making multiple commits into one commit), you always ‘s’ (squash) the second one

Gem railroady produces a UML diagram of your code structure

Kill process… somehow I created a connection with a server and then I created a second connection with a server and then couldn’t get one of those connections to close!
ps aux | grep finds the process so you can see if it’s running (I’ve since used this ps aux | grep ruby and ps aux | grep puma)
Then kill -9 prodID (number all the way to the left) kills it. Alternatively, you can also kill it by doing killall -9 thin (or whatever you’re trying to kill)