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 update -y | |
yum install php-cli -y | |
wget https://gist.githubusercontent.com/horsley/12a14498e02c994e0664/raw/a6e0dc785f2a17353860b02b163b5386a3823efa/VagexRobot.AllInOne.php | |
sed -i "s/240907/$1/" VagexRobot.AllInOne.php | |
screen -dmS vagex php VagexRobot.AllInOne.php | |
(crontab -u root -l; echo "@daily screen -X -S vagex quit; screen -dmS vagex php VagexRobot.AllInOne.php" ) | crontab -u root - |
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
<?php | |
date_default_timezone_set('Asia/Shanghai'); | |
define('DEFAULT_UA', 'Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.0'); | |
if (PHP_SAPI !== 'cli') { | |
die ("This is CLI only version!"); | |
} else { | |
$v = new Vagex(); | |
$v->set_userid('263378'); |
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 |
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
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
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
#!/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
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
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
white-space:nowrap; | |
overflow:hidden; | |
text-overflow: clip | ellipsis | ellipsis-word; |