This file contains hidden or 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
rwhere() {( | |
# Perform a recursive `where` (zsh only). | |
# | |
# Recursively resolve each alias and symbolic link until done, and do it for each potential match in PATH. | |
absolute-path() {( | |
# get absolute directory for an existing file without resolving symlinks | |
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" | |
)} |
This file contains hidden or 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 python3 | |
"""Ensure that every commit starts with a ticket ref. | |
A ticket ref regex is defined in `RE_TICKET_REF`, and by default matches tickets like "ABC-123456". The ticket must be | |
the first text in the commit message, not counting punctuation like brackets or parenthesis. When a ticket ref is | |
missing, this hook tries to guess one from the branch name, or fails the commit. | |
You can bypass this commit hook using `git commit --no-verify`. | |
""" |
This file contains hidden or 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
import asyncio | |
async def async_iterate(sync_iterable): | |
"""Convert a syncronized iterable into an async one. | |
Taken from https://stackoverflow.com/q/76991812 | |
""" | |
# to_thread errors if StopIteration raised in it. So we use a sentinel to detect the end | |
done_sentinel = object() | |
it = iter(sync_iterable) |
This file contains hidden or 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
cmake_minimum_required(VERSION 3.14.0) | |
#[=======================================================================[.rst: | |
.. command:: target_compile_warnings | |
Add warning options to a target. | |
.. signature:: | |
target_compile_warnings(<target> | |
<PRIVATE|PUBLIC|INTERFACE> | |
[GNU [flags...]] | |
[MSVC [flags...]] |
This file contains hidden or 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
// ==UserScript== | |
// @name Redirect Qt5 docs to Qt6 docs | |
// @version 1.0.1 | |
// @author bindreams | |
// @match https://doc.qt.io/qt-5/* | |
// @run-at document-start | |
// @grant none | |
// ==/UserScript== | |
// Check if a url returns 404. Return true if url does not return 404. |
This file contains hidden or 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
param( | |
[switch][Alias('s', 'silent')] $silentParameter, | |
[switch][Alias('e', 'elevate')] $elevateParameter | |
) | |
$pshost = if ($PSVersionTable.PSVersion.Major -le 5) {'powershell'} else {'pwsh'} | |
$elevate = if ($elevateParameter) {'-Verb RunAs'} else {''} | |
$finish = if ($silentParameter) {''} else {' |
This file contains hidden or 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
/** | |
* MIT No Attribution | |
* | |
* Copyright 2020-2024 Anna Zhukova | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
* software and associated documentation files (the "Software"), to deal in the Software | |
* without restriction, including without limitation the rights to use, copy, modify, | |
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so. |