Skip to content

Instantly share code, notes, and snippets.

@nimasrn
nimasrn / docker-compose.yml
Created November 15, 2021 17:53
redis replica with docker-compose
version: '3'
services:
redis:
image: redis:5.0.0
container_name: master
ports:
- "6379:6379"
networks:
- redis-replication
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 7, 2024 15:15
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

import network
import socket
import time
import struct
from machine import Pin
NTP_DELTA = 2208988800
host = "pool.ntp.org"
@DomPizzie
DomPizzie / README-Template.md
Last active May 7, 2024 15:11
A simple README.md template

Project Title

Simple overview of use/purpose.

Description

An in-depth paragraph about your project and overview of use.

Getting Started

@sebmarkbage
sebmarkbage / The Rules.md
Last active May 7, 2024 15:01
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@jgcastro89
jgcastro89 / GEPP
Created October 17, 2017 17:16
Gaussian Elimination with Partial Pivoting Modularized
import numpy as np
class GEPP():
"""
Gaussian elimination with partial pivoting.
input: A is an n x n numpy matrix
b is an n x 1 numpy array
output: x is the solution of Ax=b
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active May 7, 2024 14:59
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@rndD
rndD / sendgrid-webhook-events.type.ts
Last active May 7, 2024 14:58
Sendgrid webhook events ts type
// @see https://docs.sendgrid.com/for-developers/tracking-events/event
// There is a mistake in the offical doc. Category is array of strings. I took it from the real webhook call.
type BaseSendgridEvent = {
email: string;
timestamp: number;
'smtp-id': string;
category: string | string[];
sg_event_id: string;
sg_message_id: string;