Skip to content

Instantly share code, notes, and snippets.

View kemar's full-sized avatar

Marc Hertzog kemar

View GitHub Profile

Every Mac Retina External Display Worth Considering

Companies besides Apple and LG have finally started releasing affordable retina-scale displays. I'm collecting them here mostly for my own notes.

A proper retina-scale external display for a Mac must have a pixel density of at least 200ppi. That means a 5K monitor should be 27" diagonal. 4K 27" monitors are disqualified.

Someone on the MacRumors forum made a comprehensive, less-up-to-date table, which might be worth looking at to see if I missed anything.

Released

@kemar
kemar / toggle_function_keys.scpt
Last active December 18, 2021 19:14
AppleScript pour commuter "Utiliser les touches F1, F2 etc. comme des touches de fonction standard" dans Preferences Système.
-- osascript toggle_function_keys.scpt
-- Inspired by https://gist.github.com/alampros/2b81af6cfc564f6accd3
tell application "System Preferences"
reveal anchor "keyboardTab" of pane "com.apple.preference.keyboard"
end tell
tell application "System Events" to tell process "System Preferences"
set checkbox_target to false
@devadvance
devadvance / part_video_to_gif.sh
Created February 28, 2021 03:10
Create animated GIF and WebP from videos using ffmpeg
ffmpeg -ss $INPUT_START_TIME -t $LENGTH -i $INPUT_FILENAME \
-vf "fps=$OUTPUT_FPS,scale=$OUTPUT_WIDTH:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \
-loop $NUMBER_OF_LOOPS $OUTPUT_FILENAME
# Change these placeholders:
# * $INPUT_START_TIME - number of seconds in the input video to start from.
# * $LENGTH - number of seconds to convert from the input video.
# * $INPUT_FILENAME - path to the input video.
# * $OUTPUT_FPS - ouput frames per second. Start with `10`.
# * $OUTPUT_WIDTH - output width in pixels. Aspect ratio is maintained.

PKI for busy people

Public-key infrastructure (PKI) is an umbrella term for everything that has to do with keys and certificates.

This is a quick overview of the important stuff.

Public-key cryptography

Public-key cryptography involves a key pair: a public key and a private key. Each entity has their own. The public key can be shared around, the private key is secret.

@steven2358
steven2358 / ffmpeg.md
Last active June 10, 2025 19:47
FFmpeg cheat sheet
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active May 15, 2025 19:21
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 7, 2025 04:34
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@plentz
plentz / nginx.conf
Last active May 27, 2025 10:32
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ebidel
ebidel / Web Components Resources.md
Last active October 12, 2024 17:10
List of resources related to Web Components
@willurd
willurd / web-servers.md
Last active June 13, 2025 04:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000