Posts by: jcaveman

Git: How to undo a commit

TLDR; To undo a local commit in GIT, type $ git reset HEAD~
(that last character is a tilde, the symbol above the 6, not a dash)

If you’ve made a local commit and have not yet pushed it to a remote repository, just do $ git reset HEAD~. This will undo your commit and leave the changes unstaged.

Do $ git reset --soft HEAD~ to undo your commit but leave the changes staged (if you just need to add more changes to the commit, for example).

If you’ve already pushed your commit to a remote repo, you’ll need to revert it:

screen-shot-2016-09-25-at-9-23-05-pm

You’ll have to look up the ID, or the SHA (secure hash) for the commit you want to revert. Do this with git log:

  1. $ git log – the most recent commit is on top. The SHA in this example is a50b22ef7186d5a06248e406f18e265e3fb9b893
  2. $ git revert a50b22ef7186d5a06248e406f18e265e3fb9b893

This will likely automatically open an editor in the terminal to edit your commit message. In my case, it opens VIM. (not seen in the screenshot). You may want to add some comments explaining why you’re reverting the commit. Then save, and you’ll return to your command line, as seen in the screenshot. (To exit VIM without making changes to the commit message, just type :q <enter>).

Back to School Poster

Back to School Poster

Saw Deftones for the 4th time at Shoreline Amphitheatre in Mountain View on August 26, 2015. They were with Incubus, apparently for the first time since the Back to School tour in 2000 (which I also went to).

This show was pretty rad. The weather was perfect (as always) and the amphitheater is right by the LinkedIn office. We normally head to Sports Page first to pregame, then back again for a few more after the show. This show was on a Wednesday which happens to be karaoke night. So yeah, that too.

I took a few videos of the show. Sorry they’re so shaky, I was getting into the show and had a beer in the other hand. The videos are embedded from YouTube below with a link to download the full res original next to each one. If you want to download all of them, here’s a zip file: joncaveman.com/downloads/Deftones and Incubus at Shoreline.zip

Read More…

I started sailing in July of last year (2014) at Tradewinds Sailing School and Club. Learning to sail on the San Francisco Bay has been amazing. It’s the New York City of sailing–if you can make it here, you can make it anywhere. 🙂

skip to slideshow | skip to full video 6 minute video

I’m ASA Bareboat Charter certified (ASA 104) and I also hold my Advanced Docking and Motoring endorsement (ASA 118). My next step is Coastal Navigation, then Advanced Coastal Cruising, Celestial Navigation and then finally Passage Making. Ultimately I’d like to sail across an ocean (a la “All Is Lost” with Robert Redford).

Most of my sailing is done on the San Francisco Bay. That is, behind the Golden Gate Bridge. Cross underneath the Golden Gate and you’re in the open ocean. Now, sailing within the gate can be extremely challenging, but crossing out into the open ocean presents a whole new set of challenges. On July 19th, 2015, for the first time, I set sail for the open sea.

Read More…

Looping HTML5 video with jQuery

Backstory

Before HTML5, browsers were not able to play video natively (that is, without the use of a plugin that must be installed and does not come with the browser). It has been common place to use Flash to deliver video content; typically with videos encoded in FLV format and played through some kind of SWF player. Although this serves its purpose, it’s still not native; users have to have the flash playback component installed in their browser to playback the content.

HTML5 introduced two new tags (among others); <video> and <audio>. These tags allow browsers to play back video/audio content natively; which also means that you have a lot more control over the content using JavaScript; for example, you can build a full featured video player using Javascript, whereas before this would have to be done in Flash.

This post will just focus on the loop attribute. I’ll be explaining browser support of video formats in another post soon.

Read More…

 Scroll to top