Skip to content

Instantly share code, notes, and snippets.

@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active May 7, 2024 22:16
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@manuelmorales
manuelmorales / backup-existent-images.sh
Last active May 7, 2024 22:14
Backing up and flashing an MK808B with Finless ROM 1.5
# Read the CMDLINE
sudo ./rkflashtool r 0x0000 0x2000 > cmdline.txt
# RESULT:
# PARMWFIRMWARE_VER:4.0.4
# MACHINE_MODEL:MID
# MACHINE_ID:007
# MANUFACTURER:RK30SDK
# MAGIC: 0x5041524B
# ATAG: 0x60000800
@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 22:10
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

@Joao-Peterson
Joao-Peterson / gmk67-manual.md
Last active May 7, 2024 22:08
GMK67 manual (English)
@deepanchal
deepanchal / starship.toml
Last active May 7, 2024 22:08
Starship config
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
format = """
$username\
$hostname\
$localip\
$shlvl\
$singularity\
$kubernetes\
@blackbing
blackbing / fetchStream.js
Last active May 7, 2024 22:07
Server Sent Event with fetch stream
const url = 'https://api.example.com/v1/sse';
const accessToken = 'test';
fetch(url, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})
.then(response => {
if (response.ok && response.body) {
reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
@unstppbl
unstppbl / go_time_parsing.md
Last active May 7, 2024 22:06
Parsing custom time layout in Golang

There are some key values that the time.Parse is looking for.

By changing:

test, err := time.Parse("10/15/1983", "10/15/1983")

to

@blazewicz
blazewicz / pyenv-install.sh
Last active May 7, 2024 22:02
pyenv - Install Python 3.x with optimizations on macOS with macports
#!/bin/bash
set +x
PY_VERSION=3.10.1
export MAKE_OPTS="-j4"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-framework"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-computed-gotos"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-system-expat"
@taoyuan
taoyuan / generate_self_signed_certification.md
Last active May 7, 2024 22:01
Generation of a Self Signed Certificate

Generation of a Self Signed Certificate

Generation of a self-signed SSL certificate involves a simple 3-step procedure:

STEP 1: Create the server private key

openssl genrsa -out cert.key 2048

STEP 2: Create the certificate signing request (CSR)

openssl req -new -key cert.key -out cert.csr