Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 13:47
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Nora-Ballard
Nora-Ballard / Set-WindowState.ps1
Last active May 7, 2024 13:46
Hide, Show, Minimize, Maximize, etc window from Powershell.
function Set-WindowState {
param(
[Parameter()]
[ValidateSet('FORCEMINIMIZE', 'HIDE', 'MAXIMIZE', 'MINIMIZE', 'RESTORE',
'SHOW', 'SHOWDEFAULT', 'SHOWMAXIMIZED', 'SHOWMINIMIZED',
'SHOWMINNOACTIVE', 'SHOWNA', 'SHOWNOACTIVATE', 'SHOWNORMAL')]
[Alias('Style')]
[String] $State = 'SHOW',
[Parameter(ValueFromPipelineByPropertyname='True')]
@oleksiilevzhynskyi
oleksiilevzhynskyi / grammarly_web_frontend_resources.md
Last active May 7, 2024 13:45
Grammarly web front-end resources
@eegrok
eegrok / mac-keycodes
Last active May 7, 2024 13:45
Mac virtual keycodes
from: http://www.meandmark.com/keycodes.html
with some additions from people in the comments, thanks :)
Virtual Keycodes for the Mac QWERTY Layout
Keycodes are in hexadecimal. A blank entry means either there is no key assigned to that keycode or I was unable to find the assigned key.
Keycode Key
0x00 A
0x01 S
0x02 D
@naiieandrade
naiieandrade / emojis_unicode.md
Last active May 7, 2024 13:44
Unicode emojis for Telegram
emoji unicode emoji unicode
✒️ :black_nib: \U00002712 ✔️ :heavy_check_mark: \U00002714
✖️ :heavy_multiplication_x: \U00002716 ‼️ :bangbang: \U0000203C
✳️ :eight_spoked_asterisk: \U00002733 :sparkles: \U00002728
:grey_exclamation: \U00002755 ✴️ :eight_pointed_black_star: \U00002734
❄️ :snowflake: \U00002744 ❇️ :sparkle: \U00002747
:x: \U0000274c :negative_squared_cross_mark: \U0000274e
@mbostock
mbostock / .block
Last active May 7, 2024 13:44
Radial Stacked Bar
license: gpl-3.0
height: 960
redirect: https://observablehq.com/@d3/d3-radial-stacked-bar-chart
# https://hub.docker.com/repository/docker/aleleba/code-server
FROM codercom/code-server:3.12.0
RUN sudo apt-get update
#Instalando Node.js
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
RUN sudo apt -y install nodejs
#Terminando de Instalar Node.js
@kolebynov
kolebynov / Program.cs
Created May 7, 2024 13:38
Fixed stack/heap array with any element type
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
var list1 = new FixedList<string, Buffer16<string>>();
var list2 = new FixedList<string, Buffer32<string>>();
UseList(ref list1, "Hello");
UseList(ref list2, "World");
Console.WriteLine(list1.GetRef(0));
Console.WriteLine(list2.GetRef(0));
@aquelito
aquelito / git-command.md
Last active May 7, 2024 13:42
GIT - Ligne de commande principale
title category
Git config
Git

Rappel

Ne pas oublier : l'aide en ligne de commande.

@xfournet
xfournet / pluginHttp2Proxy.ts
Last active May 7, 2024 13:42
Vite support for HTTP2 and proxy
import proxy from 'http2-proxy';
import type { Plugin, ProxyOptions } from 'vite';
export const pluginHttp2Proxy = (): Plugin => {
let routes: Record<string, string | ProxyOptions>;
return {
name: 'vite-plugin-http2-proxy',
config: (config) => {
const { server } = config;
routes = server?.proxy ?? {};