Skip to content

Instantly share code, notes, and snippets.

@dstibrany
dstibrany / gist:8bf2e4a4f55a6d610660
Created June 9, 2015 15:43
Segfault stacktrace
PID 17275 received SIGSEGV for address: 0x3da827c00018
/var/hubdoc/hdrobots/node_modules/segfault-handler/build/Release/segfault-handler.node(+0xfce)[0x7ffd76585fce]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7ffd76d5ccb0]
/var/hubdoc/node-v0.10.36/out/Release/node(_ZN2v88internal20StaticMarkingVisitorINS0_32IncrementalMarkingMarkingVisitorEE15MarkMapContentsEPNS0_4HeapEPNS0_3MapE+0xe7)[0x7c0677]
/var/hubdoc/node-v0.10.36/out/Release/node(_ZN2v88internal18IncrementalMarking4StepElNS1_16CompletionActionE+0x355)[0x7b71b5]
/var/hubdoc/node-v0.10.36/out/Release/node(_ZN2v88internal4Heap14CollectGarbageENS0_15AllocationSpaceENS0_16GarbageCollectorEPKcS5_+0x1d3)[0x763643]
/var/hubdoc/node-v0.10.36/out/Release/node(_ZN2v88internal7Factory17NewRawAsciiStringEiNS0_13PretenureFlagE+0xcc)[0x73314c]
/var/hubdoc/node-v0.10.36/out/Release/node(_ZN2v88internal10JsonParserILb0EE18SlowScanJsonStringINS0_14SeqAsciiStringEcEENS0_6HandleINS0_6StringEEES7_ii+0x59)[0x896169]
/var/hubdoc/node-v0.10.36/out/Release/node(_ZN2v88
@dstibrany
dstibrany / auth.js
Created June 8, 2015 22:34
auth module of knox library
"use strict";
/*!
* knox - auth
* Copyright(c) 2010 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
/**
* Module dependencies.
@dstibrany
dstibrany / auth.js
Last active August 29, 2015 14:22
Reduced test case for node bug when dealing with S3
"use strict";
/*!
* knox - auth
* Copyright(c) 2010 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
/**
* Module dependencies.
@dstibrany
dstibrany / gist:10662037
Created April 14, 2014 16:14
Creates a blank first page in wkhtmltopdf
<table>
<tr>
<td>
...lots of content......lots of content.lots of content......lots of content......lots of content... of content...
...lots of content......lots of content.lots of content......lots of content......lots of content... of content...
...lots of content......lots of content.lots of content......lots of content......lots of content... of content...
...lots of content......lots of content.lots of content......lots of content......lots of content... of content...
...lots of content......lots of content.lots of content......lots of content......lots of content... of content...
...lots of content......lots of content.lots of content......lots of content......lots of content... of content...
...lots of content......lots of content.lots of content......lots of content......lots of content... of content...
@dstibrany
dstibrany / lsof.js
Last active December 26, 2015 04:39
var cluster = require('cluster');
var http = require('http');
var cp = require('child_process');
if (cluster.isMaster) {
var worker = cluster.fork();
}
else {
server = http.createServer(); // number of servers is arbitrary
server2 = http.createServer();
define([
"app",
"modules/document/documentmodels"
],
function(app, DocumentModels) {
var Views = {};
@dstibrany
dstibrany / gist:3259917
Created August 4, 2012 21:03
Search View
define([
"app",
"modules/search/searchmodels"
],
function(app, SearchModels) {
var Views = {};
@dstibrany
dstibrany / gist:3259865
Created August 4, 2012 20:54
Document Preview Template
{{#if empty}}
{{else}}
<div id="document-actions">
<div id="document-actions-top">
<div class="display">
<h3>{{filename}}</h3>
</div>
<div class="edit">
<div class="control-group">
define([
"app",
//modules
"modules/document/views"
],
function(app, Views) {
var Document = app.module();