Skip to content

Instantly share code, notes, and snippets.

View QuynhVir's full-sized avatar
🏠
Working from home

Vir QuynhVir

🏠
Working from home
  • Midgard
View GitHub Profile
@QuynhVir
QuynhVir / lazy-load-puppeteer.js
Created September 17, 2023 07:04 — forked from schnerd/lazy-load-puppeteer.js
Lazy-loading content in Puppeteer
function wait (ms) {
return new Promise(resolve => setTimeout(() => resolve(), ms));
}
export default async function capture(browser, url) {
// Load the specified page
const page = await browser.newPage();
await page.goto(url, {waitUntil: 'load'});
// Get the height of the rendered page

Setup

  • Create a developer account with Apple
  • Download and install X-Code from the Apple App Store
  • Open and run X-Code app and install whatever extras it requires
  • Open the preferences pane (cmd+,)
    • click the + in the lower right corner
    • choose Apple ID
    • enter your apple ID and password
@QuynhVir
QuynhVir / hdrtosdr.sh
Created September 6, 2022 14:18 — forked from SCG82/hdrtosdr.sh
Convert HDR video to SDR with tone mapping (especially for iPhone 12)
#!/bin/bash
#************************************************
# hdrtosdr.sh *
# v1.0.0 *
# developer: SCG82 (scg082+mp4towebp@gmail.com) *
#************************************************
USAGE_S="Usage: $0 -s [start time hh:mm:ss] -e [end time hh:mm:ss] -w width -h height -p preset FILE"
USAGE="Usage (arguments are optional): $0 -s [start time hh:mm:ss] -e [end time hh:mm:ss] -w [output width] -h [output height] -p [preset: ultrafast,superfast,veryfast,faster,fast,medium,slow,slower,veryslow,placebo] FILE"
@QuynhVir
QuynhVir / systemd_service_hardening.md
Created December 9, 2021 01:59 — forked from ageis/systemd_service_hardening.md
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@QuynhVir
QuynhVir / README.md
Created April 3, 2021 06:03 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@QuynhVir
QuynhVir / AdbCommands
Created August 27, 2020 01:54 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@QuynhVir
QuynhVir / made-with-love.html
Created December 3, 2019 14:22 — forked from oliveratgithub/made-with-love.html
Various HTML-snippets to add "Made with love" to your website
<!-- Example #1 - no styling -->
Made with ❤ in Switzerland
<!-- Example #2 - inline-styled ❤ -->
Made with <span style="color: #e25555;">&#9829;</span> in Switzerland
Made with <span style="color: #e25555;">&hearts;</span> in Switzerland
<!-- Example #3 - CSS-style class for ❤ -->
<style>.heart{color:#e25555;}</style>
Made with <span class="heart">❤</span> in Switzerland
@QuynhVir
QuynhVir / svg2icns
Created November 25, 2019 07:12 — forked from zlbruce/svg2icns
covert svg to icns (with imagemagick)
#!/bin/bash
echo "*** SVG 2 ICNS ***"
if [ $# -ne 1 ]; then
echo "Usage: svg2icns filename.svg"
exit 100
fi
filename="$1"
name=${filename%.*}
ext=${filename##*.}
echo "processing: $name"
@QuynhVir
QuynhVir / gist:289618282a16091c0949b8d7fcd45a94
Last active March 26, 2020 09:50 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>