Skip to content

Instantly share code, notes, and snippets.

View victorporof's full-sized avatar
🔥

Victor Porof victorporof

🔥
View GitHub Profile
@victorporof
victorporof / profile.json
Created February 23, 2023 10:17
profile.json
This file has been truncated, but you can view the full file.
{
"scripts": [],
"styles": []
}
// @ts-ignore
const scheduleAsyncTask = console.scheduleAsyncTask ?? (() => {});
// @ts-ignore
const startAsyncTask = console.startAsyncTask ?? (() => {});
// @ts-ignore
const finishAsyncTask = console.finishAsyncTask ?? (() => {});
interface ConsoleTask {
run<T>(f: () => T): T;
}
@victorporof
victorporof / alina-framework.js
Created June 27, 2022 09:32
Framework templating example
const queue = [];
const elements = new Map();
let counter = 0;
export function addWork(work) {
const id = counter++;
queue.push({ ...work, id });
return id;
}
@victorporof
victorporof / devtools.html
Last active May 13, 2022 07:23
Perf Extension
<!DOCTYPE html>
<html>
<head>
<script src="devtools.js"></script>
</head>
</html>
@victorporof
victorporof / rxjs-async-stack-tagging.html
Last active May 31, 2022 16:11
RxJS + Async Stack Tagging
<!-- macOS: open -a Google\ Chrome\ Canary --args --js-flags="--experimental-async-stack-tagging-api" -->
<!-- Linux: chrome --js-flags="--experimental-async-stack-tagging-api" -->
<!DOCTYPE html>
<html lang="en">
<head>
<script type="module">
import * as rxjs from "https://unpkg.com/rxjs@7?module";
// Wraps `rxjs::from` to also schedule an async task.
@victorporof
victorporof / async-stack-tagging-recurring.js
Last active May 30, 2022 06:25
Async Stack Tagging API (Recurring)
/* --- Userland --- */
function makeUpdate(i) {
return function someUpdate() {
console.trace(`completeUpdate: update ${i}`);
};
}
function businessLogic() {
scheduler.scheduleTask("foo", [makeUpdate(1), makeUpdate(2), makeUpdate(3)]);
@victorporof
victorporof / async-stack-tagging-non-recurring.js
Last active May 30, 2022 06:25
Async Stack Tagging API (Non-Recurring)
/* --- Userland --- */
function someTask() {
console.trace("completeWork: someTask");
}
function someOtherTask() {
console.trace("completeWork: someOtherTask");
}
@victorporof
victorporof / config.fish.sh
Last active July 18, 2022 08:59
config.fish
# Enviroment setup
# Path vars
set -gx PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin
set -gx PATH /opt/homebrew/bin $PATH
set -gx PATH $PATH $HOME/.local/bin
set -gx PATH $PATH $HOME/.cargo/bin
set -gx PATH $PATH $HOME/.yarn/bin