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
| // tests if we can get super in .toString() | |
| fnTest = /xyz/.test(function() { | |
| xyz; | |
| }) ? /\b_super\b/ : /.*/, | |
| // overwrites an object with methods, sets up _super | |
| // newProps - new properties | |
| // oldProps - where the old properties might be | |
| // addTo - what we are adding to | |
| inheritProps = function( newProps, oldProps, addTo ) { |
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
| var ExtendedInventory = Inventory.extend({ | |
| defaults: { | |
| rabit:25 | |
| } | |
| }); | |
| _.extend(ExtendedInventory.prototype.defaults, Inventory.prototype.defaults); | |
| // or |
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
| white-space:nowrap; | |
| overflow:hidden; | |
| text-overflow: clip | ellipsis | ellipsis-word; |
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
| private View applyLifecycleMethods(String viewName, AbstractView view) { | |
| return (View) getApplicationContext().getAutowireCapableBeanFactory().initializeBean(view, viewName); | |
| } | |
| //参考 UrlBasedViewResolver |
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
| import org.apache.commons.io.FilenameUtils; | |
| String extension = FilenameUtils.getExtension(fileName); |
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
| #!/bin/bash | |
| #直观当繁琐的写法 | |
| if [ ! $1 ]; then | |
| $1='default' | |
| fi | |
| #当变量a为null时则var=b | |
| var=${a-b} |
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
| val = (x, ctx, args) => | |
| if _.isFunction x | |
| x.apply ctx or this, args or [] | |
| else | |
| x | |
| [ | |
| openWith | |
| replaceWith | |
| closeWith | |
| repaceHolder |
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
| yum remove -y pptpd ppp | |
| iptables --flush POSTROUTING --table nat | |
| iptables --flush FORWARD | |
| rm -rf /etc/pptpd.conf | |
| rm -rf /etc/ppp | |
| wget http://www.diahosting.com/dload/dkms-2.0.17.5-1.noarch.rpm | |
| wget http://www.diahosting.com/dload/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm | |
| wget http://www.diahosting.com/dload/pptpd-1.3.4-1.rhel5.1.i386.rpm | |
| wget http://www.diahosting.com/dload/ppp-2.4.4-9.0.rhel5.i386.rpm |
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
| #! /usr/bin/env coffee | |
| # convert amount from figures to words | |
| # @author vangie.du | |
| # @url http://codelife.me/blog/2013/03/09/convert-amount-from-figures-to-words-by-coffeescript/ | |
| # @version 1.1 | |
| # @since 2013-03-09 | |
| if process.argv.length >= 3 | |
| n = parseFloat(process.argv[2]).toFixed(2) |
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 apt-get install php5-curl | |
| wget https://gist.githubusercontent.com/horsley/12a14498e02c994e0664/raw/a6e0dc785f2a17353860b02b163b5386a3823efa/VagexRobot.AllInOne.php | |
| sed -i "s/240907/$1/" VagexRobot.AllInOne.php | |
| screen -S vagex -d -m php VagexRobot.AllInOne.php |
OlderNewer