/Share +-XXX +-YYY
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
const typeTextMap = { | |
normal: '一般', | |
fire: '火', | |
water: '水', | |
grass: '草', | |
electric: '電', | |
fighting: '格鬥', | |
flying: '飛行', | |
poison: '毒', | |
bug: '蟲', |
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
define([ | |
'underscore' | |
,'marionette' | |
], function(_, Marionette){ | |
var $ = Marionette.$; | |
// Extend Marionette.Application for async initialization | |
var AppBase = Marionette.Application.extend({ | |
constructor: function(options){ |
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 | |
header('Content-Length: 0'); | |
$key = array(); | |
$base = urldecode($_SERVER['REQUEST_URI']); | |
$base_ori = $_SERVER['REQUEST_URI']; | |
$key[] = $base; | |
$key[] = $base.'zh'; | |
$key[] = $base.'zh-hans'; | |
$key[] = $base.'zh-hant'; | |
if (strpos($base, '/wiki/') !== FALSE) { |
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 | |
header('Content-Length: 0'); | |
$url = 'http://static.52poke.com/purge'.$_SERVER['REQUEST_URI']; | |
@file_get_contents($url); | |
file_put_contents( | |
'/home/52poke/logs/wiki-imagepurge.log', | |
'Purge '.$url.' '.date(DATE_ATOM)."\n", | |
FILE_APPEND | |
); |
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
var exec = require('child_process').exec, | |
fs = require('fs'), | |
async = require('async'); | |
var services = [ 'php-fpm', 'nginx', 'mysqld', ['mongod', 'mongodb'], ['redis-server', 'redis'] ]; | |
var logFile = '/home/52poke/logs/monitor.log'; | |
var actions = []; | |
var addLog = function(str){ | |
fs.appendFileSync(logFile, new Date().toString()+ str + '\n'); |
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
var exec = require('child_process').exec, | |
fs = require('fs'); | |
var errorCount = 0; | |
function getCPU(callback){ | |
exec('top -b -n 1 -p `pgrep memcached`', function(error, stdout, stderr){ | |
var lines = stdout ? stdout.split('\n') : [''], | |
str = lines[lines.length - 1].substring(47, 52); |