This file contains hidden or 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
| /** | |
| * Copyright (c) 2023 The xterm.js authors. All rights reserved. | |
| * @license MIT | |
| */ | |
| import { InWasm, OutputMode, OutputType } from 'inwasm-runtime'; | |
| // memory addresses in uint32 | |
| const enum P32 { | |
| // 1. byte table |
This file contains hidden or 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 { InWasm, OutputMode, OutputType } from 'inwasm'; | |
| const BYTES = new Uint8Array(786432*16); | |
| const DATA = new Uint8Array(1048576*16); | |
| const PIXELS = 262144*16; | |
| for (let i = 0; i < BYTES.length; i+= 3) { | |
| BYTES[i] = 50; | |
| BYTES[i+1] = 100; |
This file contains hidden or 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 time import sleep, monotonic | |
| import statistics as st | |
| import psycopg | |
| import psycopg2 | |
| DSN = 'dbname=psycopg_test host=localhost user=postgres password=mysecretpassword' | |
| table = """ | |
| CREATE TEMPORARY TABLE int_testtable ( | |
| id serial PRIMARY KEY, |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
NewerOlder