Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| /** | |
| * Converts an RGB color value to HSL. Conversion formula | |
| * adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
| * Assumes r, g, and b are contained in the set [0, 255] and | |
| * returns h, s, and l in the set [0, 1]. | |
| * | |
| * @param Number r The red color value | |
| * @param Number g The green color value | |
| * @param Number b The blue color value | |
| * @return Array The HSL representation |
| #!/bin/bash | |
| # | |
| # Enable TRIM support for 3rd Party SSDs. Works for Mountain Lion, should work on earlier OSes too. | |
| # Tested on 10.8.2, 10.8.3, 10.8.5, 10.9.0-10.9.5, 10.10.0-10.10.1, 10.10.4 | |
| # | |
| # Run this script at your own risk, whether on 10.10 or earlier. | |
| # | |
| # This script works on MacOS 10.10-10.10.1 (Yosemite) but it has significant system security repercussions. | |
| # To use it you must disable kext signing on your machine. This makes it easier for | |
| # malware to infect your machine by disabling the feature which would detect unsigned |
| # | |
| # UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs | |
| # just run "sudo trimforce enable" to activate the trim support from now on! | |
| # | |
| # Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/) | |
| # Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/ | |
| # | |
| # Looks for "Apple" string in HD kext, changes it to a wildcard match for anything | |
| # | |
| # Alternative to http://www.groths.org/trim-enabler-3-0-released/ |
Since this is on Hacker News and reddit...
_t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".char *s.type * name, however, is entirely intentional.Tested against the WebKit git repo by entering the repo with 1 file dirty.
git diff --quiet --ignore-submodules HEAD # Will tell if there are any uncomitted changes, staged or not.
0.6 sec
git diff-index --quiet HEAD # Only tracked
2 sec
| After upgrading to Mountain Lion : 10.8 I noticed that I was getting Python errors which prevented me from starting vim: | |
| Traceback (most recent call last): | |
| File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 565, in <module> | |
| File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 547, in main | |
| File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 278, in addusersitepackages | |
| File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 253, in getusersitepackages | |
| File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getuserbase | |
| File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 523, in get_config_var | |
| File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 419, in get_config_vars |
| /*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
| that detects and handles AJAXed content. | |
| Usage example: | |
| waitForKeyElements ( | |
| "div.comments" | |
| , commentCallbackFunction | |
| ); |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |