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
#!/bin/bash |
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
#!/bin/sh | |
# | |
# This hook does two things: | |
# | |
# 1. update the "info" files that allow the list of references to be | |
# queries over dumb transports such as http | |
# | |
# 2. if this repository looks like it is a non-bare repository, and | |
# the checked-out branch is pushed to, then update the working copy. | |
# This makes "push" function somewhat similarly to darcs and bzr. |
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
Looks like your eth0 is not set up. Here is what I did to fix mine on CentOS 6.4. | |
sudo su - | |
cat /etc/sysconfig/network |grep -i network | |
This should return: NETWORKING=yes - If it does not, then change it to yes. | |
vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
This should look like: |
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
//TEST issue #8118 | |
//Nodejs is attempting to re-create a http request if the request-handler may exec more time #8118 | |
//See: https://github.com/joyent/node/issues/8118 | |
console.log('/******* Current Node *******/'); | |
console.log(process.versions); | |
console.log(process.platform); | |
console.log('/****************************/'); | |
var test_timeout_visited = false; | |
var test_timeout_count = 0; |
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
//强制置顶窗口 | |
void ForceForegroundWindow(HWND hWnd) { | |
DWORD thread1, thread2, pid; | |
thread1 = ::GetWindowThreadProcessId(::GetForegroundWindow(), &pid); | |
thread2 = ::GetCurrentThreadId(); | |
::AttachThreadInput(thread2, thread1, TRUE); | |
::SetForegroundWindow(hWnd); | |
::AttachThreadInput(thread2, thread1, FALSE); | |
::BringWindowToTop(hWnd); | |
} |
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
//---精灵图操作 | |
@spritePic: '../images/sprites.png'; //精灵图地址 | |
.fn-setSprite (@width, @height, @x, @y) { | |
width: @width + 0px; | |
height: @height + 0px; | |
background: url(@spritePic) 0px - @x 0px - @y; | |
} | |
.fn-setSpriteXY (@x, @y) { | |
background-position: 0px - @x 0px - @y; | |
} |
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
/** | |
* 通用通信加密验证库【注:传递的参数名仅支持:数字、大小写字母】 | |
* @author Wilson Zeng jackzcs@gmail.com | |
* @version 0.0.1 | |
*/ | |
(function () { | |
// Establish the root object, `window` in the browser, or `exports` on the server. | |
var root = this; | |
//依赖自由的md5 |
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
/** | |
* 设置或获取某对象的多级属性 | |
* @param {[type]} obj [可选]要设置或获取的对象,默认为空对象 | |
* @param {[type]} key 获取或设置的键名 | |
* @param {[type]} value 若为undefined则表示获取值,!undefined表示设置值 | |
* @param {[type]} defaultValue 默认值,当获取值时,若值不存在则返回defaultValue | |
* @return {[type]} 当为设置时,返回obj本身,为获取时,返回对应属性值 | |
*/ | |
function getsetObject (obj, key, value, defaultValue) { | |
obj = obj || {}; |
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 zlib = require('zlib'); | |
var Readable = require('stream').Readable; | |
var Transform = require('stream').Transform; | |
var count = 0, data = ['t007', '是', '个', 'idiot!']; | |
function MyReader (opts) { | |
Readable.call(this, opts); | |
}; | |
MyReader.prototype = Object.create(Readable.prototype); | |
MyReader.prototype._read = function (size) { |
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
server { | |
listen 80; | |
listen 443; | |
server_name zx250local.com; | |
# 测试,转发实现跨域 | |
# 后面就可以这样在zx250local.com域名下发起其他域名的AJAX请求了,比如: | |
# $.getJSON('/cross/http%3a%2f%2fmobile.minmetals.com.cn%3a8050%2fwkjt%2fversion.html%3f1479282583007', function(result){console.log(result)}) | |
location ~ /cross/(?<target>.+) { # 请求时,<target>中最好全部urlencode一遍 | |
# rewrite /cross/(.+)$ /$1 break; |
OlderNewer