This file contains 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
# disable local snapshots feature of time machine | |
sudo tmutil disablelocal | |
# undo | |
#sudo tmutil enablelocal | |
# delete all mobile backups | |
# repeat after every new backup drive selection | |
sudo rm -r /.MobileBackups |
This file contains 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
# | |
# 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/ | |
# Method behind this madness described: http://forums.macrumors.com/showthread.php?t=1409151&page=4 | |
# See discussion in comments here: https://www.macupdate.com/app/mac/39654/lion-tweaks | |
# And here: http://forums.macrumors.com/showthread.php?t=1410459 |
This file contains 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
function lengthOf(object) { | |
var element_count = 0; | |
for (e in object) { element_count++; } | |
return element_count; | |
} | |
function _jqCacheSize(){return lengthOf($.cache);} |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
function declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
use: | |
declOfNum(count, ['товар', 'товара', 'товаров']); |