Skip to content

Instantly share code, notes, and snippets.

View leeight's full-sized avatar
💭
I may be slow to respond.

Li YuBei leeight

💭
I may be slow to respond.
View GitHub Profile
@leeight
leeight / .screenrc
Created August 18, 2015 02:49
.screenrc
#
# Example of a user's .screenrc file
#
# This is how one can set a reattach password:
# password ODSJQf.4IJN7E # "1234"
# no annoying audible bell, please
vbell on
@leeight
leeight / BOS WEB SDK
Created June 2, 2015 14:58
BOS WEB SDK
[toc]
# BOS WEB SDK
## 目的
为 BOS 的用户提供一种更简便,直接的方式管理 BOS 上面所属的资源。
BOS WEB SDK 提供两种服务?工具?:
@leeight
leeight / doubel2ieee754.js
Created June 20, 2014 13:54
JavaScript Double 2 IEEE754 format
function toIEEE754( d ) {
var a = new Float64Array( [ d ] );
var b = new DataView( a.buffer );
var f = [];
for(var i = 0; i < b.byteLength; i ++ ){
var k = b.getUint8( 7 - i );
var e = k.toString( 2 );
var p = new Array( 9 - e.length ).join( 0 );
f.unshift( p + e );
}
// assumes little endian
// constants taken from http://nikic.github.com/2012/02/02/Pointer-magic-for-efficient-dynamic-value-representations.html
var MAXDOUBLE = 0xfff80000,
INT32TAG = 0xfff90000,
BOOLTAG = 0xfffa0000;
var heap = new ArrayBuffer(24),
f64 = new Float64Array(heap),
ui32 = new Uint32Array(heap),
var assert = console.assert;
var DOUBLE = 0,
INT32 = 1,
BOOL = 2,
PTR = 3;
var MAXDOUBLE = 0xfff80000,
INT32TAG = 0xfff90000,
BOOLTAG = 0xfffa0000,
@leeight
leeight / boot.js
Created June 7, 2014 13:32 — forked from jdx/boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
@leeight
leeight / test.less.js
Created May 8, 2014 03:51
test.less.js
/***************************************************************************
*
* Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
* $Id$
*
**************************************************************************/
/**
@leeight
leeight / edp-1.0.0.patch
Created May 6, 2014 07:46
app/ecom/union/trunk/besc-static
diff --git a/edp-build-config.js b/edp-build-config.js
index d578422..439935f 100644
--- a/edp-build-config.js
+++ b/edp-build-config.js
@@ -77,9 +77,6 @@ exports.exclude = [
'*.sh'
];
-var moduleEntries = 'html,htm,phtml,tpl,vm,js';
-var pageEntries = 'html,htm,phtml,tpl,vm';
@leeight
leeight / edp-1.0.0.patch
Created May 5, 2014 03:54
app/ecom/union/trunk/besc-static
diff --git a/edp-build-config.js b/edp-build-config.js
index 1719429..7aed5d9 100644
--- a/edp-build-config.js
+++ b/edp-build-config.js
@@ -42,25 +42,25 @@ exports.output = path.resolve(cwd, args.output || 'output');
* @type {Array}
*/
exports.exclude = [
- '/src/static/tpl/*',
- '/tool',
@leeight
leeight / gist:11366820
Created April 28, 2014 09:37
hello-image
17:37:05: (Libpurple: hello-image) download image type = 1, md5 = c5ce7689438e5ee92c5942d4885fc198
17:37:05: (Libpurple: hello-image) in image_process_request, type = 27
17:37:05: (Libpurple: hello-image) write-len 36
17:37:05: (Libpurple: hello-image) write-len 36
17:37:05: (Libpurple: hello-image) download image type = 1, md5 = 2f5113cfd0a33bfec485c222051db205
17:37:05: (Libpurple: hello-image) in image_process_request, type = 27
17:37:05: (Libpurple: hello-image) write-len 36
17:37:05: (Libpurple: hello-image) write-len 36
17:37:05: (Libpurple: hello-image) size_to_read = 36
17:37:05: (Libpurple: hello-image) cursize = 0