Skip to content

Instantly share code, notes, and snippets.

View Vuzereus's full-sized avatar
💭
I may be slow to respond.

Vuzereus

💭
I may be slow to respond.
View GitHub Profile
@Vuzereus
Vuzereus / indexeddb.html
Created September 7, 2023 13:36 — forked from jdiamond/indexeddb.html
IndexedDB Example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>IndexedDB Example</title>
</head>
<body>
<h1>IndexedDB Example</h1>
<p>
@Vuzereus
Vuzereus / simple-multi-threaded-php-web-server.md
Created September 10, 2023 14:26 — forked from Jiab77/simple-multi-threaded-php-web-server.md
An easy way to start the embedded PHP web server with the multi-thread option enabled or simulated when necessary.
@Vuzereus
Vuzereus / rest-api-response-format.md
Created September 11, 2023 16:10 — forked from igorjs/rest-api-response-format.md
REST API response format based on some of the best practices
@Vuzereus
Vuzereus / gpg_git_signing.md
Created September 11, 2023 16:16 — forked from igorjs/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
function calcDistanceInMetresBetweenTwoPoints(Point1, Point2) {
const EARTH_RADIUS = 6371e3; // 6,371,000 metres
const latitude1 = (Point1.lat * Math.PI) / 180;
const latitude2 = (Point2.lat * Math.PI) / 180;
const deltaLatitude = ((Point2.lat - Point1.lat) * Math.PI) / 180;
const deltaLongitude = ((Point2.lon - Point1.lon) * Math.PI) / 180;
const angle =
@Vuzereus
Vuzereus / ffmpeg-common.sh
Created November 12, 2023 13:36 — forked from tiantuxu/ffmpeg-common.sh
Common ffmpeg Command Lines (with NVIDIA GPU Support)
# Decode a video to yuv420 raw format
ffmpeg -vsync 0 -c:v h264_cuvid -i input.mp4 -c:v rawvideo -pix_fmt yuv420p -f null /dev/null
ffmpeg -vsync 0 -c:v h264_cuvid -i input.mp4 -c:v rawvideo -pix_fmt yuv420p output.yuv
# Resize videos to 640x480
ffmpeg -c:v h264_cuvid -i input.mp4 -vf scale=640:480 -c:v h264_nvenc output.mp4
# Downsampling frame rate to 30fps
ffmpeg -i input.mp4 -r 30 -c:v h264_nvenc output.mp4