Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules |
*update: TBC, but this new might affect how easy it is to use this technique past August 2024: Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August
This gist, based in part on a gist by Brian Hartvigsen, allows you to export from Authy your TOTP tokens you have stored there.
Those can be "standard" 6-digits / 30 secs tokens, or Authy's own version, the 7-digits / 10 secs tokens.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Pre-requisite: You have to know your last commit message from your deleted branch. | |
git reflog | |
# Search for message in the list | |
# a901eda HEAD@{18}: commit: <last commit message> | |
# Now you have two options, either checkout revision or HEAD | |
git checkout a901eda | |
# Or | |
git checkout HEAD@{18} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ------------------------------------------------------------------- | |
-- THIS SCRIPT IS NOW DEPRECATED IN FAVOR OF A MORE ROBUST SOLUTION -- | |
-- Please refer to https://github.com/cmer/lg-tv-control-macos/ | |
-- ------------------------------------------------------------------- | |
local tv_identifier = "LG TV" | |
local mac_address = "aa:bb:cc:dd:ee:ff" | |
local tv_found = (hs.screen.find(tv_identifier) ~= nil) | |
local debug = false -- Set to true to enable debug messages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""MkDocs hook for performance debugging | |
The idea behind it is to provide a minimal curated performance log for a `mkdocs build` run. | |
Of course anyone can use a proper profiler, but the output often contains a lot of non-critical data | |
that the user has to first filter to get a clearer picture. This hook takes care of this and allows | |
to quickly see where a bottleneck is occurring. It also has a lower overhead than a proper profiler. | |
It creates a file in the current working directory, it can be configured easily with variables set | |
at the bottom of the file. There are also the timing categories included. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Description | |
This PHP snippet enhances the security and organization of the WordPress media library by enforcing user-specific access controls. | |
It ensures that users can only view, edit, and delete their own uploaded media files, not those uploaded by others. | |
This functionality is particularly useful in multi-author WordPress environments where maintaining individual user | |
media privacy is crucial. By integrating this code, administrators can streamline media management and safeguard user | |
content from unauthorized access. | |
1. Copy this PHP snippet and paste it into your snippet editor, then save it. | |
2. Ensure that you have already granted the user access to the media library in WordPress before using this custom code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git log --shortstat | grep -E "(Author: )(\b\s*([A-Z]\w+)){2}|fil(e|es) changed" | awk ' | |
{ | |
if($1 ~ /Author/) { | |
author = $2" "$3 | |
} else { | |
files[author]+=$1 | |
inserted[author]+=$4 | |
deleted[author]+=$6 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Author: Darius Foo (darius.foo.tw@gmail.com) | |
# License: GPLv3 | |
from z3 import * | |
set_param(proof=True) | |
s = Solver() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
work_dir=/tmp/random-wallpaper | |
lite_archive_url=https://unsplash.com/data/lite/latest | |
lite_archive_path=${work_dir}/unsplash-research-dataset-lite-latest.zip | |
photos_tsv_archive_path=photos.tsv000 | |
photos_tsv_path=${work_dir}/photos.tsv | |
photos_tsv_dir_path=$(dirname ${photos_tsv_path}) | |
declare -a screens=(3840x2160 3840x2160 1920x1080) |
NewerOlder