Skip to content

Instantly share code, notes, and snippets.

@Jekins
Jekins / Markdown-docs.md
Last active May 12, 2024 03:47
Руководство по оформлению Markdown файлов

Руководство по оформлению Markdown файлов

Markdown - это облегчённый язык разметки, который преобразует текст в структурированный HTML. Следующее руководство поможет вам разобраться, как использовать Markdown.

Заголовки

# Заголовок первого уровня
## Заголовок второго уровня
### Заголовок третьего уровня
#### Заголовок четвёртого уровня
##### Заголовок пятого уровня
@branneman
branneman / primitive-reference-types-javascript.md
Last active May 12, 2024 03:45
Primitive Types & Reference Types in JavaScript

Primitive Types & Reference Types in JavaScript

An explanation of JavaScript's pass-by-value, which is unlike pass-by-reference from other languages.

Facts

  • JavaScript has 2 kinds of variable types: primitive and reference.
  • A fixed amount of memory is reserved after creation of every variable.
  • When a variable is copied, it's in-memory value is copied.
  • Passing a variable to a function via a call also creates a copy of that variable.

Primitive Types

@hiepxanh
hiepxanh / style.css
Last active May 12, 2024 03:42
using vscode extension: custom css and js loader
.editor-group-watermark > .letterpress{
background-image: url("https://raw.githubusercontent.com/hiepxanh/hiepxanh/master/Angular.png") !important;
opacity: .75;
}
@mdgrs-mei
mdgrs-mei / ShellIntegration.ps1
Last active May 12, 2024 03:36
Adds escape codes to the prompt for the shell integration
# Reference:
# https://devblogs.microsoft.com/commandline/shell-integration-in-the-windows-terminal/
param
(
[ValidateSet('WindowsTerminal', 'ITerm2')]
[String]$TerminalProgram = 'WindowsTerminal'
)
# Restore hooked functions in case this script is executed accidentally twice
@amosbastian
amosbastian / route.ts
Last active May 12, 2024 03:35
Lemon Squeezy webhook using the new route handler in Next.js 13
import crypto from "crypto";
import { listAllSubscriptions } from "lemonsqueezy.ts";
import { NextRequest } from "next/server";
// Put this in your billing lib and just import the type instead
type LemonsqueezySubscription = Awaited<ReturnType<typeof listAllSubscriptions>>["data"][number];
const isError = (error: unknown): error is Error => {
return error instanceof Error;
};
@ryanhamley
ryanhamley / use-svg-as-icon-image-mapboxgl.js
Last active May 12, 2024 03:35
This gist shows how to use an <svg> element as an icon-image for a Mapbox GL symbol layer
// How to add an SVG as a symbol layer's icon image: https://github.com/mapbox/mapbox-gl-js/issues/5529#issuecomment-340011876
// Also see here: https://stackoverflow.com/a/11765731/2748013 (we need the data url stuff for the image src)
// NOTE: Importing SVGs requires an inline module loader such as https://github.com/webpack-contrib/svg-inline-loader
import template from './templates/marker.svg';
const width = 20;
const height = 40;
const img = new Image(width, height);
// map is your Mapbox GL map object
@Johel-code
Johel-code / comandos.md
Created May 12, 2024 03:35
Notas de comandos Git

Notas de comandos Git

Configuración inicial:

  • git config --global user.name "Tu Nombre": Configura tu nombre de usuario.
  • git config --global user.email "tu@email.com": Configura tu dirección de correo electrónico.

Creación de un repositorio:

@vasanthk
vasanthk / System Design.md
Last active May 12, 2024 03:33
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@fnky
fnky / ANSI.md
Last active May 12, 2024 03:30
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27