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
1.Connection.prototype.attachListeners 里面 self.emit(msg.name, msg); 应该try {}catch(e){} 包起来 | |
2.Client.prototype.connect 里面 con.on('error', function(error) -> return self.emit('error', error); 不能 return | |
3.这两个地方可以在任意一个地方try 或者 process.on('uncaughtException', function(err){}),否则 连上又断的时候导致process crash | |
4.client.on('error',,, | |
client.connect(function(){}) 可能导致on的error收不到 | |
5.DeAsync.js 对 seneca.http可行 对 seneca.tcp不行 可能原因是tcp的pipe代理等的问题 |
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
from: https://github.com/montagejs/mr/blob/master/browser.js | |
// Here we use a couple tricks to make debugging better in various browsers: | |
// TODO: determine if these are all necessary / the best options | |
// 1. name the function with something inteligible since some debuggers display the first part of each eval (Firebug) | |
// 2. append the "//# sourceURL=location" hack (Safari, Chrome, Firebug) | |
// * http://pmuellr.blogspot.com/2009/06/debugger-friendly.html | |
// * http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/ | |
// TODO: investigate why this isn't working in Firebug. | |
// 3. set displayName property on the factory function (Safari, Chrome) |
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
Write After End error in node.js webserver | |
you need do sth | |
if(!res || !res.status || !res.socket || !res.socket.readable)return; | |
or next() | |
or 在回调函数前加 return | |
or 把 response 作为参数传递给其他函数 |
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
CREATE OR REPLACE FUNCTION pgjson.upsert( | |
key text, | |
data jsonb) | |
RETURNS void AS | |
$BODY$ | |
BEGIN | |
LOOP | |
UPDATE pgjson.main SET doc = data WHERE id = key; | |
IF found THEN | |
RETURN; |
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
in express.js | |
var global_app; | |
function createApplication(ifglobal) { | |
if(ifglobal && global_app){ | |
return global_app; | |
} | |
var app = function(req, res, next) { | |
app.handle(req, res, next); | |
}; |
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
编译 v8 core.deltaBaseCacheLimit=2g 错误 | |
修改 depot_tools/gclient_utils.py | |
return '512m' |
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
ps -ef|grep postgres | |
sudo apt install postgresql-9.6 | |
sudo /etc/init.d/postgresql stop | |
检查 | |
修改/etc/postgresql/9.5/main/pg_hba.conf,确保本机信任访问 | |
local all postgres peer | |
修改/etc/postgresql/9.6/main/pg_hba.conf,确保本机信任访问 |
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
titanium_mobile-master\android\titanium\src\java\org\appcelerator\titanium\util\TiUIHelper.java | |
import java.io.File;//liyong | |
line-432 before | |
} catch (IOException e) {"Unable to load 'fonts' assets. Perhaps doesn't exist? " | |
//liyong | |
File f = null; | |
f = context.getDir("appdata",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
tiapp.xml | |
<property name="ti.android.root.actas.launcher" type="bool">true</property>下面用到作为判断 | |
<property name="ti.android.root.reappears.restart" type="bool">false</property>这个在ti代码里面查得到 | |
<activity | |
android:configChanges="keyboardHidden|orientation" | |
android:label="Lyapp上升" | |
android:name=".LyappActivity" android:theme="@style/Theme.Titanium" | |
android:screenOrientation="nosensor" | |
android:excludeFromRecents="false" | |
android:resumeWhilePausing="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
apt install -t jessie-backports openjdk-8-jre-headless ca-certificates-java |
OlderNewer