This file contains 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
SELECT | |
d.parent_id, views, cdn, | |
from_unixtime(1405267200 + row_number * 60) as step_time | |
FROM | |
(SELECT | |
apptype_id, game_id, count(view_id) AS views, r.row_number, | |
sum(bytes_loaded_cdn1 + bytes_loaded_cdn2 + bytes_loaded_cdn3 + bytes_loaded_cdn4) /duration as cdn | |
FROM | |
(SELECT | |
@curRow:=@curRow + 1 AS row_number |
This file contains 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
" this is the configuration file for linux and mac systems | |
" symlink this to your home folder as .vimrc | |
" It loads pathogen and loads all modules from ~/.vim/bundles. | |
" It then loads ~/.vimrc_main which has the main | |
" configuration that works across all systems. | |
call pathogen#runtime_prepend_subdirectories(expand('~/.vim/bundles')) | |
call pathogen#helptags() | |
source ~/.vimrc_main |
This file contains 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 | |
function getTaobaoURLFromShortURL($shortURL) | |
{ | |
$contents = file_get_contents($shortURL); | |
$pattern = '/d="J_Url" value=\'(.+)\'>./'; | |
preg_match($pattern, $contents, $matches); | |
return urldecode($matches[1]); | |
} | |
function getItemIdFromURL($itemURL) |
This file contains 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
package com.xindianbao.isv; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.concurrent.ExecutionException; | |
import com.google.common.cache.CacheBuilder; |
This file contains 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
package com.xindianbao.isv; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import org.gearman.Gearman; | |
import org.gearman.GearmanClient; | |
import org.gearman.GearmanServer; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
This file contains 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
find . -name "*-lastUpdated" -or -name "*-not-available" -exec rm {} \; | |
find . -size 0 -exec rm {} \; |
This file contains 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
// 第一个是原文的,但是不对的,下面的第二个是我修改的。 | |
// original from http://jamiedubs.com/ps1-collection-customize-your-bash-prompt | |
// export PS1="\[\e[01;32m\]\u@\h \[\e[01;34m\]\W \`if [ \$? = 0 ]; then echo -e '\e[01;32m:)'; else echo -e '\e[01;31m:('; fi\` \[\e[01;34m\]$\[\e[00m\] " | |
export PS1="\[\e[01;32m\]\u@\h \[\e[01;34m\]\W \`if [ \$? = 0 ]; then echo -e '\[\e[01;32m\]:)'; else echo -e '\[\e[01;31m\]:('; fi\` \[\e[01;34m\]$\[\e[00m\] " |
This file contains 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 bash | |
java -jar dbmigrate.jar $* | |
# 在 windows 中编辑的 shell 脚本复制到 linux 运行出现 : No such file or directory 错误 | |
# 你绝对想不到,上面的代码在 shell 看来应该是下面这样的 | |
#!/usr/bin/env bash^M | |
java -jar dbmigrate.jar $*^M | |
# 运行 dos2unix ,去掉 \r 即可。 |
This file contains 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
$ redis-cli incr next.news.id | |
(integer) 1 | |
$ redis-cli set news:1:title "Redis is simple" | |
OK | |
$ redis-cli set news:1:url "http://code.google.com/p/redis" | |
OK | |
$ redis-cli lpush submitted.news 1 | |
OK |
This file contains 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
this="${BASH_SOURCE-$0}" | |
dir=$(cd -P -- "$(dirname -- "$this")" && pwd -P) |
OlderNewer