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
###################### | |
## shadowsocks-libev | |
###################### | |
# install dependencies | |
yum install epel-release -y | |
yum install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto udns-devel libev-devel -y | |
# install shadowsocks-libev | |
cd /etc/yum.repos.d/ |
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
# Copyright (c) 2018 Xue Can <xuecan@gmail.com> | |
""" | |
## 监控子进程输出的管理器 | |
这个模块提供了一个进程输出的监视器,它使用 Popen 启动子进程并持续监控输出。只要子进程 | |
输出是以行为基础的文本输出,就可以使用这个模块提供的监视器监控。特别的,如果需要监控的 | |
是日志文件等,实际上是转化为 `tail -F` 来监视进程的。 | |
最初,这个模块就是为了配合 `tail -F` 使用而编写的,后续发展到能够处理任何只输出,不需要通过 |
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
/*! | |
Copyright (C) 2015-2017 Xue Can <xuecan@gmail.com> and contributors. | |
Licensed under the MIT license: http://opensource.org/licenses/mit-license | |
*/ | |
// TypeScript 的 import 语句要求模块名称是字符串字面量(不能是模板、变量等) | |
// 有时候我们需要根据当前文件名做一些相对的导入(通常结合 requirejs 插件) | |
// 这个 gulp 插件用于替换 import 语句中如下形式的字符串: | |
// | |
// - @@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
/*! | |
Copyright (C) 2015-2017 Xue Can <xuecan@gmail.com> and contributors. | |
Licensed under the MIT license: http://opensource.org/licenses/mit-license | |
*/ | |
// requirejs-css.js - A simple requirejs plugin for stylesheets injection. | |
define({ | |
load: function (name, req, onload, config) { | |
if (!config.isBuild) { | |
var link = document.createElement("link"); |
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
/** | |
* 错误处理器 | |
* | |
* 将 `E_USER_ERROR`、 `E_WARNING`、 `E_USER_WARNING` 和 `E_RECOVERABLE_ERROR` | |
* 错误转成 `\ErrorException` 异常抛出。其它类型的错误信息保留使用默认的错误处理机制。 | |
* | |
* @throws \ErrorException 对于需要转换的错误,抛出异常 | |
* @return bool 对于无需转换的错误,总是返回 false | |
*/ | |
function handleErrorException($errno, $errstr, $errfile = __FILE__, $errline = __LINE__) |
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 | |
/** | |
* @copyright Copyright (C) 2006-2016 Xue Can <xuecan@gmail.com> and contributors. | |
*/ | |
namespace Singleton; | |
/** | |
* Singleton Design Pattern | |
* |
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 selector = '#highlights' // Replace this with the selector for the element you want to make transformable | |
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() { | |
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() { | |
(function() { | |
var $, applyTransform, getTransform, makeTransformable; | |
$ = jQuery; |
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 python3 | |
# -*- coding: UTF-8 -*- | |
# Copyright (c) 2015 Netpas Tech-Development Co. Ltd. | |
import shlex | |
import ipaddress | |
DIFF = 10 # 毫秒 | |
DEFAULT_NETMASK = ipaddress.IPv4Address('255.255.255.0') |
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 os | |
def walk(r='.'): | |
for cd,_,fns in os.walk(r): | |
for fn in fns: | |
yield os.path.join(cd,fn) | |
def check(fn,enc='utf8'): | |
try: | |
with open(fn,'r',encoding=enc) as f: |
NewerOlder