Skip to content

Instantly share code, notes, and snippets.

Dmitry Soshnikov DmitrySoshnikov

Block or report user

Report or block DmitrySoshnikov

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 filter-props.js
/**
* Filter object properties.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style license, 2019
*/
const filterProps = (
[p1, p2, p3],
{
View async-iterators-example.js
/**
* Async iterators simple example.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT Style License, 2018
*/
async function* streamChunks() {
yield genChunk(1);
yield genChunk(2);
View malloc.js
/**
* Educational "Free-list" memory allocator.
*
* Maintains explicit list of free memory blocks, reuses blocks on free.
* Implements "first-fit" strategy. Uses pre-allocated heap of 64 bytes,
* with 32-bit machine word size.
*
* TODO:
*
* - Implement "best-fit" strategy
View snake6502.asm
; ___ _ __ ___ __ ___
; / __|_ _ __ _| |_____ / /| __|/ \_ )
; \__ \ ' \/ _` | / / -_) _ \__ \ () / /
; |___/_||_\__,_|_\_\___\___/___/\__/___|
; An annotated version of the snake example from Nick Morgan's 6502 assembly tutorial
; on http://skilldrick.github.io/easy6502/ that I created as an exercise for myself
; to learn a little bit about assembly. I **think** I understood everything, but I may
; also be completely wrong :-)
@DmitrySoshnikov
DmitrySoshnikov / syntax.s
Created Jan 27, 2018 — forked from mishurov/syntax.s
AT&T assembly syntax and IA-32 instructions
View syntax.s
# --------
# Hardware
# --------
# Opcode - operational code
# Assebly mnemonic - abbreviation for an operation
# Instruction Code Format (IA-32)
# - Optional instruction prefix
# - Operational code
View int16.js
/**
* int16, and uint16 numbers in JS.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*/
const assert = require('assert');
/**
* Converts a number to signed 16-bit integer.
View agent-smith.js
// agent-smith.js
/**
* Receive shared array buffer in this worker.
*/
onmessage = (message) => {
// Worker's view of the shared data.
let heapArray = new Int32Array(message.data);
let indexToModify = 1;
View event-loop.js
/**
* Event loop.
*
* Read details here:
* http://dmitrysoshnikov.com/ecmascript/javascript-the-core-2nd-edition/#job
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*/
/**
View dfa-minimization.js
/**
* DFA minization.
*
* A DFA table is minimized using N-equivalence algorithm.
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*/
/**
* Non-minizied DFA table for `/a|b/`.
@DmitrySoshnikov
DmitrySoshnikov / NFA-DFA-RegExp.js
Last active Apr 15, 2019
Classic RegExp implementation (NFA, DFA)
View NFA-DFA-RegExp.js
/**
* Classic RegExp implementation (NFA, DFA).
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
* MIT License, 2017
*/
/**
* Epsilon.
*/
You can’t perform that action at this time.