Skip to content

Instantly share code, notes, and snippets.

Avatar

H. Ozgan netologist

View GitHub Profile
@netologist
netologist / clean_code.md
Created November 18, 2022 11:50 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin
View clean_code.md

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

@netologist
netologist / Vault_examples.md
Created November 13, 2022 14:25 — forked from stenio123/Vault_examples.md
Vault Examples
View Vault_examples.md

Vault Examples

Examples highligthing different Vault features.

To have a list of valid CLI flags, use

vault -h
vault <FEATURE> -h

HA Replication

@netologist
netologist / latency.markdown
Created July 11, 2022 12:08 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.markdown

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

@netologist
netologist / asyncio.wait.py
Created May 25, 2022 11:55 — forked from Integralist/asyncio.wait.py
[Wait for multiple Python futures to finish using asyncio.wait()] #asyncio #wait #concurrency #multiple #requests #httpclient
View asyncio.wait.py
import time
import asyncio
import requests
domain = 'http://integralist.co.uk'
a = '{}/foo?run={}'.format(domain, time.time())
b = '{}/bar?run={}'.format(domain, time.time())
async def get(url):
print('start: ', url)
@netologist
netologist / cka-ckad-bookmarks
Created February 25, 2021 19:51 — forked from milindchawre/cka-ckad-bookmarks
Bookmarks for cka and ckad exam
View cka-ckad-bookmarks
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1604897638" LAST_MODIFIED="0" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3>
<DL><p>
View gist:31e63c88ca769337969d9c70db86d597
(cd /some/dir && zip -r - dir-there) > file.zip
https://unix.stackexchange.com/questions/77605/change-working-directory
@netologist
netologist / Dockerfile
Last active October 13, 2017 04:28
nginx react unsupported
View Dockerfile
FROM nginx:alpine
ADD dist/ /usr/share/nginx/html
ADD /docker/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
View gist:9db82507b189b46963946c24e0b2a2dd
https://www.ximedes.com/test-redux-action-creators-with-jest/
@netologist
netologist / photos-date-changer.sh
Last active May 18, 2017 06:36
photos-date-changer.sh
View photos-date-changer.sh
#!/bin/bash
for folder in */ ; do
d1=${folder%%_*}
for file in "$folder"*; do
echo "$file"
if [[ $file =~ \.(avi|AVI|mpeg|mpg|mov|wmv|mp4)$ ]]; then
datestr=${d1//' '/'-'}
f=${file%%.*};
View Go vendoring
#!/bin/sh
if [ "$1" == "" ]; then
echo "Usage: $0 <PROJECT_ROOT> <GITHUB_REPO>"
exit 1
fi
if [ "$2" == "" ]; then
echo "Usage: $0 <PROJECT_ROOT> <GITHUB_REPO>"
exit 1
fi