Skip to content

Instantly share code, notes, and snippets.

@nadavrot
nadavrot / Matrix.md
Last active July 21, 2024 17:27
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@TimvanScherpenzeel
TimvanScherpenzeel / support-table-webgl1-webgl2.md
Created April 5, 2018 07:52
Support table - WebGL & WebGL2 support
Device OS OS version Browser Browser version WebGL WebGL2
Apple iPad 5th iOS 11.0.3 Mobile Safari 11.0 X
Apple iPad Air 2 iOS 8.4 Mobile Safari 8.0 X
Apple iPad Mini 3 iOS 8.1.2 Mobile Safari 8.0 X
Apple iPad Pro iOS 11.2.1 Mobile Safari 11.0 X
Apple iPhone 5S iOS 8.1.3 Mobile Safari 8.0 X
Apple iPhone 6 Plus iOS 8.1 Mobile Safari 8.0 X
Apple iPhone 6 iOS 8.1.3 Mobile Safari 8.0 X
Apple iPhone 6S Plus iOS 9.0.1 Mobile Safari 9.0 X
@yuvalbl
yuvalbl / test_v8.js
Last active September 30, 2018 06:00
Test cases on v8
// run with :
// node --trace_deopt --allow-natives-syntax FILENAME
function adder(a, b) {
return new Function('a', 'b', 'return b%2 ? a + b : b%3 ? a - b : b%5 ? b / a : a * b')(a, b);
}
function addereval(a, b) {
return eval('b%2 ? a + b : b%3 ? a - b : b%5 ? b / a : a * b');
}
@addyosmani
addyosmani / bytecode.md
Last active May 28, 2022 22:40
Thoughts on precompiling JS bytecode for delivery through a server/CDN

Some quick thoughts on https://twitter.com/dan_abramov/status/884892244817346560. It's not ignorant at all to ask how browser vendors approach performance. On the V8 side we've discussed bytecode precompilation challenges a few times this year. Here's my recollection of where we stand on the idea:

JavaScript engines like V8 have to work on multiple architectures. Every version of V8 is different. The architectures we target are different. A precompiled bytecode solution would require a system (e.g the server or a CDN) to generate bytecode builds for every target architecture, every version of V8 supported and every version of the JavaScript libraries or bundles bytecode is being generated for. This is because we would need to make sure every user accessing a page using that bytecode can still get the final JS successfully executed.

Consider that if a cross-browser solution to this problem was desired, the above would need to be applied to JavaScriptCore, SpiderMonkey and Chakra as well. It would need to ca

@JetLua
JetLua / orientation.js
Last active June 9, 2024 14:55
pixijs 屏幕自适应
const resize = () => {
let
w = window.innerWidth,
h = window.innerHeight,
l, t
// 横屏
if (window.innerWidth / window.innerHeight >= 1) {
view.style.transform = 'rotate(0)'
window.GAME_ROTATE = 0
if (window.innerWidth / window.innerHeight >= GAME_RATIO) {
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active July 23, 2024 14:54
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@taylorhughes
taylorhughes / user-agents.txt
Last active April 6, 2024 16:07
A list of iOS embedded webview User-Agents
SAFARI 10.0.1
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1
CHROME on 10.0.1
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.86 Mobile/14A403 Safari/601.1.46
FACEBOOK MESSENGER
Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Mobile/14A403 [FBAN/MessengerForiOS;FBAV/87.0.0.24.69;FBBV/38293694;FBRV/0;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iPhone OS;FBSV/10.0.1;FBSS/2;FBCR/AT&T;FBID/phone;FBLC/en_US;FBOP/5]
TWITTER FOR IPHONE
@cryzed
cryzed / fix-infinality.md
Last active June 24, 2024 02:24
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@animeoakes
animeoakes / renderer.js
Created December 20, 2016 20:46
Render pixi.js on top of three.js in the same <canvas> element
const pixi = require('pixi.js');
const three = require('three');
// Create the pixi.js renderer
const pixiRenderer = pixi.autoDetectRenderer(512, 512, { transparent: true });
// Create the three.js renderer
const threeRenderer = new three.WebGLRenderer();
threeRenderer.setSize(window.innerWidth, window.innerHeight);
threeRenderer.autoClear = false;
@Flix01
Flix01 / edtaa3func.h
Last active May 26, 2024 19:21
A Signed Distance Font Builder for Dear ImGui
/*
* edtaa3()
*
* Sweep-and-update Euclidean distance transform of an
* image. Positive pixels are treated as object pixels,
* zero or negative pixels are treated as background.
* An attempt is made to treat antialiased edges correctly.
* The input image must have pixels in the range [0,1],
* and the antialiased image should be a box-filter
* sampling of the ideal, crisp edge.