| My thoughts on writing tiny reusable modules that each do just one | |
| thing. These notes were adapted from an email I recently sent. | |
| *** | |
| If some component is reusable enough to be a module then the | |
| maintenance gains are really worth the overhead of making a new | |
| project with separate tests and docs. Splitting out a reusable | |
| component might take 5 or 10 minutes to set up all the package | |
| overhead but it's much easier to test and document a piece that is |
| #!/bin/sh | |
| matches=$(git diff --cached | grep -E '\+.*?FIXME') | |
| if [ "$matches" != "" ] | |
| then | |
| echo "'FIXME' tag is detected." | |
| echo "Please fix it before committing." | |
| echo " ${matches}" | |
| exit 1 |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="https://code.jquery.com/jquery-3.0.0-alpha1.js"></script> | |
| <script src="https://cdn.jsdelivr.net/momentjs/2.10.6/moment-with-locales.min.js"></script> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| .day { |
| /* | |
| * An implementation of Ruby's string.succ method. | |
| * By Devon Govett | |
| * | |
| * Returns the successor to str. The successor is calculated by incrementing characters starting | |
| * from the rightmost alphanumeric (or the rightmost character if there are no alphanumerics) in the | |
| * string. Incrementing a digit always results in another digit, and incrementing a letter results in | |
| * another letter of the same case. | |
| * | |
| * If the increment generates a carry, the character to the left of it is incremented. This |
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Updated: 2010/12/05 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2013 Diego Perini (http://www.iport.it) | |
| // | |
| // Permission is hereby granted, free of charge, to any person |