Skip to content

Instantly share code, notes, and snippets.

Yury Delendik yurydelendik

Block or report user

Report or block yurydelendik

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
@yurydelendik
yurydelendik / record.html
Last active Sep 26, 2017
Record and playback audio.
View record.html
<!DOCTYPE html>
<html>
<head>
<title>Capture sound</title>
<meta charset="utf-8">
</head>
<body>
<div id="ask_donate">
<button id="donate">Donate the noise</button>
</div>
@yurydelendik
yurydelendik / sm_emcc.patch
Created Jun 23, 2017
Patch for emcc to enable source maps for wasm
View sm_emcc.patch
diff --git a/emcc.py b/emcc.py
index fdbefe008..54d989c16 100755
--- a/emcc.py
+++ b/emcc.py
@@ -145,6 +145,7 @@ class EmccOptions(object):
self.exclude_files = []
self.ignore_dynamic_linking = False
self.shell_path = shared.path_from_root('src', 'shell.html')
+ self.source_map_base = None
self.js_libraries = []
@yurydelendik
yurydelendik / README.md
Last active Jan 12, 2019
Build wasm maps from C++ file
View README.md
View helloworld2.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script>
var memory;
var env = {
sys: {
@yurydelendik
yurydelendik / from-mq-to-bookmarks.md
Last active May 12, 2018
Some version control operations
View from-mq-to-bookmarks.md

Overview

Provides set of operations to efficiently maintain set of patch for long time and be able to submit those for review.

GIT

Let's say we clone a repo and 'master' is upstream branch and we will keep it up-to-date on regular base.

We can created a branch for a new feature and will try to keep it fresh and with addressed reviews.

@yurydelendik
yurydelendik / sqrtOfSqrs.html
Last active Jul 1, 2016
sqrt of squares sum
View sqrtOfSqrs.html
test
<script>
var bin = atob(
"AGFzbQsAAAAEdHlwZYqAgIAAAkABAQEBQAABBAZpbXBvcnSPgICAAAEAA2VudghjYWxsYmFjawhmdW5jdGlvboKAgIAAAQEGbWVtb3J5g4CAgAAICAEGZXhwb3J0jYCAgAABAApzcXJ0T2ZTcXJzBGNvZGW5gICAAAGzgICAAAEBBAESAAAAAAAAAAAVAAIUABAAGAEAEABNBwEBFAAQAC0DABAALQMAi4kVAAYAAA+WDwRuYW1lj4CAgAABDHNxcnRfb2Zfc3FycwA=");
var ar = new Uint8Array(Array.prototype.map.call(bin, (ch) => ch.charCodeAt(0)));
var input = [3, 4];
var env = {env: { callback: (resultPtr) => {
resultPtr |= 0;
if (input.length === 0) return 0|0;
var data = +input.shift();
View !wasm-answer.md

Using WebAssembly code as JavaScript modules

Simple project structure and dependencies:

# Prepare directory and project
mkdir answer
cd answer
npm init # answer all/most with default values
npm install jspm
# We need system.js for magic
@yurydelendik
yurydelendik / parse_code_annotations.diff
Last active May 3, 2016
SM WASM with debug information
View parse_code_annotations.diff
# HG changeset patch
# User Yury Delendik <ydelendik@mozilla.com>
# Date 1462291965 18000
# Tue May 03 11:12:45 2016 -0500
# Node ID 88863f30dd23ebd15831f55b73e0e6df0ec614ae
# Parent 77cead2cd20300623eea2416bc9bce4d5021df09
Parse code annotations
diff --git a/js/src/asmjs/WasmBinary.h b/js/src/asmjs/WasmBinary.h
--- a/js/src/asmjs/WasmBinary.h
@yurydelendik
yurydelendik / hello.c
Created Apr 25, 2016
Example of wast with some debug comments
View hello.c
struct z {
int x;
float y;
} i;
int main() {
struct z t[10];
int i, j;
for (i = 0; i < 9; i++)
t[i].x = i;
@yurydelendik
yurydelendik / llvm-dgb-no-virt-v2.diff
Last active Jun 30, 2016
llvm debug hack for virtual registers
View llvm-dgb-no-virt-v2.diff
Index: lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp (revision 270942)
+++ lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp (working copy)
@@ -164,7 +164,7 @@
// Look for register defs and register masks. Register masks are
// typically on calls and they clobber everything not in the mask.
for (const MachineOperand &MO : MI.operands()) {
- if (MO.isReg() && MO.isDef() && MO.getReg()) {
+ if (MO.isReg() && MO.isDef() && TargetRegisterInfo::isPhysicalRegister(MO.getReg())) {
You can’t perform that action at this time.