This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # Author: Patrick Helm (deradon87@gmail.com), 2013 | |
| # | |
| # | |
| # Simple git-snippet to commit a small fix with auto-generated commit-message. | |
| # | |
| # ## Description | |
| # | |
| # I noticed, we developers often needs to fix a small typo or do something |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # Re-run a command whenever a file in directory is changed! | |
| # | |
| # Inspired by: http://ngauthier.com/2012/02/quick-tests-with-bash.html | |
| # Thanks Nick! | |
| # | |
| # Patrick Helm (me@patrick-helm.de), 2013 | |
| # | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def rgb_to_hsv(r, g, b) | |
| if r == b && r == g | |
| h = s = 0 | |
| v = (0.299 * r + 0.587 * g + 0.114 * b) / 255 | |
| else | |
| max = [r, g, b].max.to_f | |
| min = [r, g, b].min.to_f | |
| v = max | |
| s = min |
NewerOlder