Skip to content

Instantly share code, notes, and snippets.

Mihail Malo qm3ster

Block or report user

Report or block qm3ster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BufferWithPointer.ts
export class BufferWithPointer {
public pointer = 0
constructor(private buf: Buffer) {}
private len = this.buf.length
* Sets the buffer pointer, the address at which next parse will begin.
* @throws {RangeError} if this will put pointer outside of `0..=len` range.
* @param {number} addr What index to go to
* @returns {number} the previous pointer, before setting
qm3ster / index.js
Created Sep 19, 2017
requirebin sketch
View index.js
const pug = require('pug')
const hljs = require('highlight.js')
const beautify = require('js-beautify')
const includes = {}
Object.assign(includes, {
$pug: str => pug.render(str, includes),
$highlight: lang =>
lang === 'auto'
? str => hljs.highlightAuto(str).value
You can’t perform that action at this time.