Skip to content

Instantly share code, notes, and snippets.

View z3niths's full-sized avatar
🏆

March Kasama Kaewsainguan z3niths

🏆
View GitHub Profile
@z3niths
z3niths / latency.markdown
Created February 2, 2018 06:03 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@z3niths
z3niths / dutch_banks.json
Created January 14, 2019 09:31 — forked from wilgert/dutch_banks.json
All Dutch banks as JSON dictionary. Use this to calculate the BIC number by taking the bank_identifier part from the IBAN.
{
"ABNA":{
"BIC":"ABNANL2A",
"bank_name":"ABN AMRO BANK N.V"
},
"AEGO":{
"BIC":"AEGONL2U",
"bank_name":"AEGON BANK NV"
},
"ANDL":{
*PPD-Adobe: "4.3"
*%%%% PPD file for ZPL Label Printer with CUPS.
*%%%% Created by the CUPS PPD Compiler CUPS v1.7.5.
*% Copyright 2007-2012 by Apple Inc.
*% Copyright 1997-2007 by Easy Software Products.
*%
*% These coded instructions, statements, and computer programs are the
*% property of Apple Inc. and are protected by Federal copyright
*% law. Distribution and use rights are outlined in the file "LICENSE.txt"
*% which should have been included with this file. If this file is
@z3niths
z3niths / webpack.config.js
Created November 13, 2019 02:17 — forked from dgrigg/webpack.config.js
Webpack + Twig setup
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackNotifierPlugin = require('webpack-notifier');
const TailwindCss = require('tailwindcss');
const AutoPrefixer = require('autoprefixer');
const path = require('path');
@z3niths
z3niths / decrypt.cpp
Created June 21, 2020 18:50 — forked from haram/decrypt.cpp
Escape From Tarkov encryption defeated
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// yousif, namazso, can1357, defcon42
namespace packet
{
constexpr size_t be_xor_key = 0xd774f59d;
@z3niths
z3niths / decrypt.cpp
Created June 21, 2020 18:50 — forked from haram/decrypt.cpp
Escape From Tarkov encryption defeated
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
// yousif, namazso, can1357, defcon42
namespace packet
{
constexpr size_t be_xor_key = 0xd774f59d;
@z3niths
z3niths / postgres-cheatsheet.md
Created September 25, 2020 05:14 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.
ssl_session_cache shared:le_nginx_SSL:10m;
ssl_session_timeout 1440m;
ssl_session_tickets off;
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
-----END DH PARAMETERS-----
- Key-value / Fast / Limited space / machine memory
-- Redis , Memcache , EdgeDb
--- Caching
--- Pub/sub
--- LeaderBoard
- Wide column (key value + more dimension) / Schema-less /without joins
-- Crasandra, Apache Hbase
--- Time-series
--- Historical Records