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
| <%= f.select :invited_by_id, collection: User.approved.map {|u| [u.doc, u.id, {"names" => u.names}]} %> | |
| <label id="name"> -- </label> |
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
| .directive "onlyDigits", -> | |
| restrict: "A" | |
| require: "?ngModel" | |
| link: (scope, element, attrs, ngModel) -> | |
| return unless ngModel | |
| reg = /^-?\d*\.?\d*$/ | |
| ngModel.$parsers.unshift (inputValue) -> | |
| digits = inputValue.split("").filter((s) -> | |
| not !reg.test(s) | |
| ).join("") |
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
| directive "ngBlur", -> | |
| (scope, elem, attrs) -> | |
| elem.bind "blur", -> | |
| scope.$apply attrs.ngBlur | |
| directive "ngFocus", ($timeout) -> | |
| (scope, elem, attrs) -> | |
| scope.$watch attrs.ngFocus, (newval) -> | |
| if newval |
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
| // separator inside forms | |
| form hr{ | |
| display:block; | |
| border:none; | |
| color:white; | |
| height:1px; | |
| background:black; | |
| background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 350, from(#000), to(#fff)); | |
| } |
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
| htmlEntities: (str) -> | |
| return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''') |
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
| #init.d service for nginx | |
| wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh | |
| sudo mv init-deb.sh /etc/init.d/nginx | |
| sudo chmod +x /etc/init.d/nginx | |
| sudo /usr/sbin/update-rc.d -f nginx defaults | |
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
| full explanation: https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04 | |
| sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k | |
| sudo mkswap /swapfile | |
| sudo swapon /swapfile | |
| echo 0 | sudo tee /proc/sys/vm/swappiness | |
| echo vm.swappiness = 0 | sudo tee -a /etc/sysctl.conf | |
| sudo chown root:root /swapfile | |
| sudo chmod 0600 /swapfile |
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
| Date (Year, Month, Day): | |
| %Y - Year with century (can be negative, 4 digits at least) | |
| -0001, 0000, 1995, 2009, 14292, etc. | |
| %C - year / 100 (round down. 20 in 2009) | |
| %y - year % 100 (00..99) | |
| %m - Month of the year, zero-padded (01..12) | |
| %_m blank-padded ( 1..12) | |
| %-m no-padded (1..12) | |
| %B - The full month name (``January'') |
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
| Installation guide for Ruby stack in Ubuntu (Work In Progress) | |
| Open your terminal and copy and paste the following commands: | |
| # This will install: git, ruby and zsh: | |
| sudo apt-get update | |
| sudo apt-get install build-essential git zlib1g-dev openssl libopenssl-ruby1.9.1 libssl-dev libruby1.9.1 libreadline-dev libcurl4-gnutls-dev librtmp-dev curl -y | |
| sudo apt-get install zsh -y |
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
| File.write("server.pid", Process.pid) | |
| trap("SIGINT") do | |
| File.delete("server.pid") | |
| exit | |
| end |