Skip to content

Instantly share code, notes, and snippets.

@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active December 3, 2024 13:53
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active December 3, 2024 13:53
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@zmts
zmts / tokens.md
Last active December 3, 2024 13:52
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@xenova
xenova / tiktoken-to-hf.ipynb
Last active December 3, 2024 13:51
Convert tiktoken tokenizers to the Hugging Face tokenizers format
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active December 3, 2024 13:51
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

# Virtual memory settings.
# Kernel documentation: https://docs.kernel.org/admin-guide/sysctl/vm.html.
# Arch zram: https://wiki.archlinux.org/title/zram#Optimizing_swap_on_zram.
# Gaming tuning: https://pastebin.com/fwzW9whL.
# PopOS tuning: https://github.com/pop-os/default-settings/pull/163.
# MaxPerformanceWizard (MPW) https://gitlab.com/cscs/maxperfwiz/-/blob/master/maxperfwiz.
boot.kernel.sysctl = {
# Tunes how aggressively kernel evicts memory pages until a specific amount of free memory is left for your active working set
## Sweet spot for gaming is 125-200, near 200 makes kswapd swap too aggressive
<!DOCTYPE html>
<html>
<head>
<title>Test dijit programmatic layout</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
@import "dojo/resources/dojo.css";
@import "dijit/themes/claro/document.css";
@import "dijit/themes/claro/claro.css";
@import "dgrid/css/dgrid.css";
@PavlikPolivka
PavlikPolivka / unfollow.py
Last active December 3, 2024 13:47
SkyBlue cleanup script to unfollow inactive accounts. Fill in your handle and app password and run it like python unfollow.py --prod --days 15. It will unfollow all acounts that were not active in last 15 days.
from datetime import timezone
from atproto import Client
import datetime
client = Client()
handle = 'YOUR_HANLDE'
password = 'YOUR_APP_PASSWORD'
client.login(handle, password)
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active December 3, 2024 13:45
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@taylorthurlow
taylorthurlow / distributed_read_write_lock.rb
Last active December 3, 2024 13:43
Multi-reader, multi-writer, read-preferring distributed lock implementation for Ruby, backed by Redis
# WARNING: This locking algorithm is not yet production-tested and should not
# be used in production without further testing. Testing on a local machine
# seems to suggest that things are working as expected, but I am anticipating
# that there will be edge cases that I have missed. If you find one then feel
# free to contact me.
#
# The goal of this class is to model and provide a distributed (Redis-backed)
# multiple-reader, multiple-writer lock.
#
# The lock is read-preferring, meaning that readers will be able to read