All

Latest

System Administration

Latest

Cloud Computing

Latest

Rails, Ruby

Latest

Ruby: When to Use Symbol or String?

Symbols are just a way to name something. Typically it’s used to name attributes in a class or for options (colors, types of cuisines, type of shoe, etc). In essence, a constant string.   Use Strings instead of a...

MySQL / Percona

Latest

How to Write Your Own Iterators in Ruby

Generally if your class has an array/hash, sometimes you don’t want to expose the implementation of those collections outside of the object. Creating your own iterator will make your object easier to use. class Headphone...

Read More

How to Revert/Undo Changes in Git

Generally there are three ways of reverting changes: checkout revert reset Checkout If you just need to revert specific files, you could run git checkout to retrieve an exact version. In the below example, I wanted to revert the...

Read More

rails console hangs

“rails c” hangs with no error messages and no response. solution: stop spring using the following command “spring stop” or “bin/spring stop” spring will automatically start back up when you...

Read More

Git Best Practices

Commit often All is not Lost git log -g git fsck –unreachable git stash list Backups Although a clone is a backup it does not include git configs, working directory/index, non-standard refs, or dangling objects. Once you...

Read More

Git Relative Refs

You could use relative refs to move branches around. e.g.,  git branch -f master HEAD~3, etc.  The “^” Operator Goes up to the first parent. e.g., git checkout master^ The “~[integer]” Operator The...

Read More

Git Tools

git rebase This allows you to copy commits/branch to another commit/branch directly. You’re taking all the changes that were committed on a branch and replaying it on another. This creates a nice linear sequence of commits...

Read More
Loading