Skip to content

Instantly share code, notes, and snippets.

@jerch
jerch / a.diff
Last active June 21, 2016 15:18
xterm.js with fast keyboard input
diff --git a/demo/app.js b/demo/app.js
index c48f609..c7606ab 100644
--- a/demo/app.js
+++ b/demo/app.js
@@ -31,6 +31,7 @@ app.ws('/bash', function(ws, req) {
});
term.on('data', function(data) {
try {
+ term.write('\x13');
ws.send(data);
@jerch
jerch / index.html
Last active July 8, 2017 10:09
typed vs jsarray - creation and data insertion (http://jsbench.github.io/#af3ea1056a70df2aa6775699d174df0d) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>typed vs jsarray - creation and data insertion</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>typed vs normal - INC</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>array vs typed vs asm</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@jerch
jerch / test.ts
Created August 1, 2018 08:00
array search vs LLRB
const enum AttributeEntry {
FG = 0,
BG = 1
}
const enum FLAGS {
BOLD = 1,
UNDERLINE = 2,
BLINK = 4,
INVERSE = 8,
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
var os = require('os');
var pty = require('./lib/index');
var shell = os.platform() === 'win32'
? 'powershell.exe'
: 'bash';
process.on('exit', function(c) {
console.log('exit ' + c)
});
@jerch
jerch / idea.ts
Last active August 29, 2018 18:21
type CharDataNew = [
number, // flags 1 - current flags
number, // flags 2 - store missing RGB values
number // content - UTF32 char or pointer to combined string (at the end of the memory)
]
type SomeType = null; // to be implmented
/**
* memory layout:
const fs = require('fs');
const Terminal = require('./lib/Terminal').Terminal;
class TestTerminal extends Terminal {
writeSync(data) {
this.writeBuffer.push(data);
this._innerWrite();
}
}