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
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 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 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 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 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. |