Recent learnings...
- JST connectors - April 13, 2025
- Semantic line breaks (one sentence per line) - April 8, 2025
- The "Inverted Pyramid" in journalism - April 1, 2025
- On dashes - March 31, 2025
- Run old versions of Angular - March 20, 2025
In my opinion Git hooks are an incredibly useful yet under-utilized feature of git. There are lots of resources that go into hooks in detail but here I’m just going to list some of the ones I find myself using over and over again. prepare-commit-msg This hooks is great for templating your commit messages. This post does a great job of highlighting some powerful possibilities. I like to use it to automatically insert a ticket number from the current branch name. ...
I recently migrated my blog from Github pages to Netlify and so far it’s been an awesome experience! Netlify gives you so much for free it almost feels like stealing! If you’re hosting some static content on github pages or S3 or somewhere, I highly recommend you check them out especially if you have a static gen build process. One of the cool features Netlify gives you is configuring 301 redirects using a simple _redirects file in the root of your site. For example: ...
It’s pretty easy to configure npm to connect through a proxy by setting the proxy and https-proxy config settings and you can even use npm config set which will store them in your .npmrc file. Connecting through a corporate proxy that requires authentication, however, can be a little trickier. To specify your credentials, you have to place them in the proxy url so your npm command would look something like this: ...
TLDR: Git hooks are an awesome way to automatically verify your code as you commit your changes I’m sure we’ve all been there where we accidentally committed a change that we were supposed to undo or wasn’t ready to be pushed and don’t realize it until the build breaks or QA finds a bug. The first step I take to avoid committing anything unintentionally is instead of just running git add -A I make sure to review all the changes in the files I’m potentially committing. This is where a graphical tool like Gitk or SmartGit comes in handy as they allow you to click on your modified files and easily view a diff and then select which changes to stage. Unfortunately changes still slip through as happened to me yesterday when a change of mine got pushed all the way to Test before it was noticed. This led me to create an additional safety net. ...
Bittorrent sync is a new file sharing app released by Bittorrent Labs. People are saying its an alternative to popular file syncing services such as Dropbox, SkyDrive, etc. However I don’t currently see it as being a true replacement for these services but after playing with for the last few weeks I must say I’m impressed and I feel it does sport some cool features I’ve long wished for in a file syncing app. I’ve even incorporated it into my development workflow as I’ll outline later in this post. ...
I finally migrated my blog from Wordpress to Octopress and given all the blog posts I came across while getting it setup it seems almost like a rite of passage to blog about it once you’ve migrated. Why make the move?! For the hacker street cred of course. But seriously, I was growing really tired with the performance of Wordpress and dealing with shared hosting on Godaddy and my colleague suggested I give Octopress a try and so here I am. ...
Learn Git Git seems to be emerging as one of the most popular version control systems especially for open source projects so it would make sense to become more proficient especially given my next goal. Contribute to OSS I really want to give back and contribute to an open source project. With so many on Github hopefully learning Git will make this less intimidating. Learn a Javascript framework With javascript becoming more and more popular for creating a rich client side experience, learning and using a javascript framework is practically a necessity. I’ll probably start looking at either Knockout.js or Backbone.js. ...
This is a simple tip but one I feel makes my code a bit easier to read. I was never very pleased with the standard way of checking if a dom element exits in jquery: if($('#userName').length !== 0){ //do something with $('#firstName') } The solution I like is to create a very simple jQuery plugin to encapsulate this logic: // this extension reads better when selecting elements $.fn.exists = function () { return this .length !== 0; }; You can place this anywhere you like such as in a ‘utils.js’ file, so long as it loads after jQuery. Now your code would like so: ...
One of the most used features of jQuery is the easy methods it provides to to attach event handlers to dom elements like this simple example: $('.submitButton').click(function() { validateForm(); }); It doesn’t get much easier than that. However, a lot of times we’ll want to attach events to elements that were loaded after the initial page load such as from the result of an ajax request. This is where the .live() method comes in really handy: ...
Last weekend I attended the Global Day of Coderetreat in Dallas, TX which was not only my first Coderetreat but also my first time attending a developer community event and I have to say that it was a great and worthwhile experience. If you’re unfamiliar with the format of a Coderetreat you can read all about it at coderetreat.com but its basically a code kata where you spend most of the day pairing up in 45 min sessions and attempt to solve Conway’s Game of Life (a fascinating problem by itself). I had only first heard about it a couple weeks before when Corey Haines went on the Herding code podcast to talk about it and I’m glad I went because I feel took away a few key benefits. ...