Skip to content

Instantly share code, notes, and snippets.

@imkarimkarim
imkarimkarim / nvchad.cheatsheet
Last active January 19, 2026 04:16
chad-cheats (nvchad cheatsheet)
chad-cheats:
# based on: https://youtu.be/Mtgo-nP_r8Y
space + h + t : change theme
:TSInstall <language>(elixir) : add syntax highlighting support
:TSInstallInfo : see what syntax highlighting are already installed
@kinda-neat
kinda-neat / how-long-did-you-think-about-useLayoutEffect.md
Last active January 13, 2026 14:41
Уверены что понимаете как работает useLayoutEffect?

В доке по useLayoutEffect можно найти следующие отрывки:

  • React guarantees that the code inside useLayoutEffect and any state updates scheduled inside it will be processed before the browser repaints the screen.
  • Call useLayoutEffect perform the layout measurements before the browser repaints the screen:
  • The code inside useLayoutEffect and all state updates scheduled from it block the browser from repainting the screen. When used excessively, this makes your app slow. When possible, prefer useEffect.

Как это возможно? Как Реакт может гарантировать что код внутри useLayoutEffect и стейт апдейты запланированные внутри него будут выполнены до перерисовки экрана браузером? Как Реакт может влиять на перерисовку браузером, как может ее блокировать? Как Реакт это делает и как вы

@s-lyn
s-lyn / MANUAL.md
Created September 15, 2017 10:27
Deploy nodejs app with gitlab.com and pm2

Deploy nodejs app with gitlab.com and pm2

This manual is about setting up an automatic deploy workflow using nodejs, PM2, nginx and GitLab CI. It is tested on:

  • Target server: Ubuntu 16.04 x64. This is suitable for Ubuntu 14.x.
  • Windows 10 on my PC to work.
#!/bin/bash
# Install Shadowsocks on CentOS 7
echo "Installing Shadowsocks..."
random-string()
{
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1
}
@Stevoisiak
Stevoisiak / SO-7zip-extract-icon
Created March 6, 2017 19:38
Extract .ico icon file from .exe with 7zip
You can extract .ico icons from an exe with 7-zip!
@mikoim
mikoim / README.md
Last active October 2, 2025 02:55
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@shimizu
shimizu / .block
Last active May 30, 2018 19:59
D3 ver.4 - Axis Update Example
license: mit
@subfuzion
subfuzion / curl.md
Last active January 20, 2026 07:10
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@vigorousnorth
vigorousnorth / index.html
Last active May 28, 2019 12:15
Pie chart with rotated wedge labels
<!DOCTYPE html>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var piecolors = d3.scale.category20c();
var w = 600,
h = 460,