Skip to content

Instantly share code, notes, and snippets.

View Sc4ramouche's full-sized avatar
🐝

Vlad Kovechenkov Sc4ramouche

🐝
  • Berlin
View GitHub Profile

Adjust Frontend Day 2024

Sisyphus.

Who knows what WebAssembly is?

It is an overloaded term. Compile target, also runtime. Low-level language?

It was created to complement JavaScript on the web. Performance and portability. And it was not necessarily created for UI engineers.

let start = performance
.getEntriesByType('mark')
.find(m => m.name === 'dex-load-start');
let end = performance
.getEntriesByType('mark')
.find(m => m.name === 'dex-load-end');
let duration = Math.round(end?.startTime - start?.startTime);
console.log('dex-load:', duration)
function logPerformanceEvents() {
const resourceEntries = performance.getEntries();
resourceEntries.forEach(entry => {
console.log('Resource Name:', entry.name);
console.log('Resource Source:', entry.initiatorType);
console.log('Resource Start Time:', entry.startTime);
console.log('Resource Duration:', entry.duration);
console.log('----------------------');
});
@Sc4ramouche
Sc4ramouche / notes.md
Created January 1, 2024 21:38
Golang Notes

Frontendmasters course on Go basics — Source.

Notes

  • Three main pillars of Go philosophy: ease of coding, efficient compilation, efficient execution.l
  • main function is an entry point for a Go program.
  • Go programs consist of packages. In most cases, one can thing of a package like a folder with source code files.
  • A package actually ends up compiled as a single long file, even if you had broken up the package into multiple files.
    • This explains why variables and functions are available across files within a package.
    • Package name has no relationwith the folder name containing the package (i.e. they can be different).
@Sc4ramouche
Sc4ramouche / notes.md
Last active October 22, 2023 17:34
Vim Fundamentals – notes from Frontend Masters course

Notes on Vim Fundamentals

I have been using Vim for quite some time, and switched to Neovim about a year ago. Even though I managed to make Neovim my daily driver, I didn't yet reach the familiarity with Neovim where I could say that I'm super confident using it. So my goal was to increase my confidence with Neovim by watching this course.

The following are the notes I captured during the course:

  • There's a possibility in Neovim to setup a short blinking highlight on yank. Can be useful for me, just as a quick confirmation on the yanked region.
  • When typing any command that starts with :, you can press <C-d> to get a list of possible autocompletions. Neat.
  • :Ex opens file tree in the same buffer. :Vex does the same, but with a neat vertical split.
  • Vim allows for "recursive mappings". This means you can bind some key to a command, and then in another binding use the hotkey that was introduced earlier. There was a case in the course when binding was specifically introduced as non-recursive wit
/*
Simple iterator implementation that allows to calculate sequenced values.
Next value is calculated by the `update` function.
This construction might come in handy when it's required to generate a sequence,
but there's also no need to keep the history of previous values.
Note: could also be elegangtly descibed via class syntax with private fields.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields
*/
rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf &TMPDIR/metro-bundler-cache-*
@Sc4ramouche
Sc4ramouche / gist:d5296a8a3c5ec8548a81e2a20bf690eb
Created September 7, 2018 08:15
Clearing cache for metro bundler
rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-*
/*
Welcome fellow learners!
We are going to tackle JSdoc today.
1. Initialize your working directory
npm init -y
2. Install JSdoc locally
npm i --save-dev jsdoc
3. Create JavaScript file
touch test.js
{
"workbench.iconTheme": "vscode-icons",
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"eslint.enable": true,
"files.eol": "\n",
"editor.tabSize": 2,
"workbench.colorCustomizations": {
"editorCursor.foreground": "#d6e414"
},
"workbench.colorTheme": "Material Theme",