Skip to content

Instantly share code, notes, and snippets.

View sam-github's full-sized avatar

Sam Roberts sam-github

View GitHub Profile
echo-server-epoll
echo-server-poll
talk
talk.dSYM
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const tls = require('tls');
const util = require('util');
function read(file, encoding) {
return fs.readFileSync(path.resolve(__dirname, file), encoding);
}
@sam-github
sam-github / argp-subcommand.c
Created December 4, 2014 05:35
argp subcommand example
/*
* Sample command line parser.
*
* Implements sub-commands with their own option handlers.
*
*/
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
@sam-github
sam-github / dsl-print
Created March 6, 2012 23:26
Example of a lua DSL language
#!/usr/bin/env lua
--[[
dsl-print [some.dsl]
Example of a lua DSL language, that can use function call or assignment to define
keys, and uses call sequence to implicitly define nesting.
]]
function dsl(code, file)
local loaded, estr = loadstring(code, file)
@sam-github
sam-github / dsl.lua
Created December 7, 2012 06:20
Another DSL in lua, for Vasiliy
print"TABLE"
function directory(path)
print("directory", path)
return function(attrs)
for key,value in pairs(attrs) do
print("", key, value)
end
end
make -s jstest
ninja: Entering directory `out/Release'
ninja: no work to do.
=== release test-crypto ===
Path: parallel/test-crypto
assert.js:384
throw err;
^
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
--- ../http-parser/test.c 2020-02-13 15:17:21.151617855 -0800
+++ test/compat/compat.c 2020-02-13 16:24:50.336415270 -0800
@@ -47,6 +47,7 @@
struct message {
const char *name; // for debugging purposes
+ int skip; // Test fails compatibility
const char *raw;
enum http_parser_type type;
enum http_method method;
core/llhttp (master u=) % mocha -r ts-node/register/type-check test/*-test.ts
warning: overriding the module target triple with x86_64-pc-linux-gnu [-Woverride-module]
free(): double free detected in tcache 2
Stack dump:
0. Program arguments: /usr/bin/clang -g3 -Os -fvisibility=hidden -I /home/sam/w/core/llhttp/node_modules/llparse-test-fixture/src/native -include /home/sam/w/core/llhttp/test/tmp/http-loose-none.h /home/sam/w/core/llhttp/node_modules/llparse-test-fixture/src/native/fixture.c -msse4.2 -DLLHTTP__TEST -DLLPARSE__ERROR_PAUSE=20 -include /home/sam/w/core/llhttp/test/tmp/cheaders.h /home/sam/w/core/llhttp/test/fixtures/extra.c -DLLHTTP__TEST_HTTP /home/sam/w/core/llhttp/src/native/http.c /home/sam/w/core/llhttp/test/tmp/http-loose-none.bc -o /home/sam/w/core/llhttp/test/tmp/http-loose-none.e5a02487fb9fff6a94ad98e11b3b6f87930fc6dee6d749fbf4a02c8977cbe68f
1. Per-module optimization passes
2. Running pass 'Dead Argument Elimination' on module '/home/sam/w/core/llhttp/test/tmp/http-loose
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap
# Possible reasons:
# The system is out of physical RAM or swap space
# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap
# Possible reasons:
# The system is out of physical RAM or swap space
# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full