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
#Modify Array prototype | |
class Array | |
#Sorts numerically descending, period | |
#separated occurences ie. file.10.1.2.3.git | |
def sort_by_version_number! | |
regex = /(([0-9]+\.?){4,})\./ | |
self.sort! do |a,b| | |
#Get version numbers | |
a = Gem::Version.new(a.match(regex)[1]) | |
b = Gem::Version.new(b.match(regex)[1]) |
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
# Sudo system control to fix memory in current session | |
sudo sysctl -w kern.sysv.shmall=65536 | |
sudo sysctl -w kern.sysv.shmmax=16777216 | |
# Fix memory bug for future sessions | |
cat << 'EOF' >> /etc/sysctl.conf | |
kern.sysv.shmall=65536 | |
kern.sysv.shmmax=16777216 | |
EOF |
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
define [], -> | |
# Handles site-wide event delegations for all elements. | |
# @param selector The CSS-style element selector. | |
# @param event The event to bind to, click, hover, mouseenter, etc. | |
# @param handler The handler function to execute on event firing | |
# return void | |
(selector, event, handler) -> | |
# Define function to wrap the handler function in |
NewerOlder