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
| 查看系统提供的JDK版本信息 | |
| $ /usr/sbin/alternatives --config java | |
| 配置SunJDK | |
| # /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_27/bin/java 2 | |
| # /usr/sbin/alternatives --config java | |
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
| .replace { | |
| display:block; | |
| height:0; | |
| overflow:hidden; | |
| font-size:0; | |
| letter-spacing:-1em; | |
| text-indent:-1000em; | |
| } | |
| .heading { | |
| width:135px; |
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 generate_password(length=6) | |
| chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789' | |
| password = '' | |
| length.times { |i| password << chars[rand(chars.length)] } | |
| password | |
| end |
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
| gem install bundler --pre | |
| gem install mongoid bson_ext haml heroku rb-inotify libnotify guard-livereload mini_magick carrierwave carrierwave-mongoid client_side_validations |
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
| gem list | cut -d" " -f1 | xargs gem uninstall -aIx |
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
| @foo.current_page | |
| @foo.num_pages | |
| @foo.limit_value | |
| @foo.total_count | |
| @foo.last_page? | |
| @foo.first_page? | |
| @foo.num_pages |
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
| // top-level namespace being assigned an object literal | |
| var myApp = myApp || {}; | |
| // a convenience function for parsing string namespaces and | |
| // automatically generating nested namespaces | |
| function extend( ns, ns_string ) { | |
| var parts = ns_string.split('.'), | |
| parent = ns, | |
| pl, i; | |
| if (parts[0] == "myApp") { | |
| parts = parts.slice(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
| cat ~/.ssh/id_dsa.pub | ssh me@remotebox "cat >> ~/.ssh/authorized_keys" |
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
| /System/Library/CoreServices/Dock.app/Contents/Resources |
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
| # place it in /etc/openvpn/server.conf | |
| port 53 | |
| proto udp | |
| dev tun | |
| ca /etc/openvpn/ca.crt | |
| cert /etc/openvpn/server.crt | |
| key /etc/openvpn/server.key | |
| dh /etc/openvpn/dh1024.pem |