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
import re | |
from io import StringIO | |
from decimal import Decimal | |
# TODO: | |
# - investigate: late column casts better than early? (make temp table all text?) | |
# - encoder/decoder for all django field types | |
# - sanitize method interfaces of CopyConverter / more django-like | |
# - Do we need a temp file shim instead of StringIO for very big data? | |
# - Better with ByteIO instead of StringIO? |
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
#!/bin/bash | |
function smiling_smiley() { | |
echo -ne '\x1bP;2q"1;1;60;60 | |
#6!60~$- | |
!60~$- | |
!60~$ | |
!15?#1!4]!22?!4]$- | |
#6!60~$- | |
!60~$- |
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
const pty = require('./lib/index'); | |
var ptyProcess = pty.spawn('bash', [], { | |
name: 'xterm-color', | |
cols: 80, | |
rows: 30, | |
cwd: '/', | |
env: process.env | |
}); |
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
import { Terminal, ITerminalAddon, IBufferCell } from 'xterm'; | |
export class SerializeAddon implements ITerminalAddon { | |
private _terminal: Terminal|undefined = undefined; | |
public dispose(): void {} | |
public activate(terminal: Terminal): void { | |
this._terminal = terminal; | |
} | |
private _extractAttributes(oldCell: IBufferCell, newCell: IBufferCell): string { |
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
import { Terminal, ITerminalAddon } from 'xterm'; | |
export const enum Attributes { | |
/** | |
* bit 1..8 blue in RGB, color in P256 and P16 | |
*/ | |
BLUE_MASK = 0xFF, | |
BLUE_SHIFT = 0, | |
PCOLOR_MASK = 0xFF, | |
PCOLOR_SHIFT = 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
var Module = require('module'); | |
var originalRequire = Module.prototype.require; | |
// monkey patch require paths | |
Module.prototype.require = function() { | |
const path = arguments[0]; | |
if (path.slice(0, 6) === 'common') { | |
return require('xterm/out/' + path); | |
} | |
if (path.slice(0, 4) === 'core') { |
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
#!/bin/bash | |
# Tom Hale, 2016. MIT Licence. | |
# Print out 256 colours, with each number printed in its corresponding colour | |
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163 | |
set -eu # Fail on errors or undeclared variables | |
printable_colours=256 |
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
import { perfContext, before, ThroughputRuntimeCase } from '..'; | |
//import * as xterm from 'xterm'; | |
import { Terminal as TerminalType } from 'xterm/src/Terminal'; | |
const Terminal: typeof TerminalType = require('xterm/lib/Terminal').Terminal; | |
const pty = require('xterm/node_modules/node-pty'); | |
class TestTerminal extends Terminal { | |
writeSync(data: string) { | |
this.writeBuffer.push(data); |
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
const Terminal = require('xterm/lib/Terminal').Terminal; | |
const pty = require('xterm/node_modules/node-pty'); | |
const perfContext = require('../lib/index').perfContext; | |
const before = require('../lib/index').before; | |
const RuntimeCase = require('../lib/index').RuntimeCase; | |
class TestTerminal extends Terminal { | |
writeSync(data) { | |
this.writeBuffer.push(data); | |
this._innerWrite(); |
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
const fs = require('fs'); | |
const Terminal = require('./lib/Terminal').Terminal; | |
class TestTerminal extends Terminal { | |
writeSync(data) { | |
this.writeBuffer.push(data); | |
this._innerWrite(); | |
} | |
} |
NewerOlder