Skip to content

Instantly share code, notes, and snippets.

View bindreams's full-sized avatar
🏳️‍⚧️

Anna Zhukova bindreams

🏳️‍⚧️
  • 18:47 (UTC +03:00)
View GitHub Profile
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...]]
@bindreams
bindreams / tm-qtdocs.js
Last active July 5, 2021 15:39
Tampermonkey: Redirect Qt5 docs to Qt6 docs
// ==UserScript==
// @name Redirect Qt5 docs to Qt6 docs
// @version 1.0.1
// @author andreasxp
// @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.
@bindreams
bindreams / launch.ps1
Last active January 17, 2021 20:52
Script that launches a command in a new window. Prints exit code upon finish (-s to supress).
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 {'
@bindreams
bindreams / svstream.hpp
Last active March 30, 2024 12:08
string_view compatible std::istringstream.
/**
* 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.
@bindreams
bindreams / fsequence.py
Created February 2, 2020 11:34
Function sequence implementation (python).
def _fsequence_iter(iterator):
"""Create and return a single callable that calls arguments in sequence and passes the result to the next callable.
Calls are performed in order in which they were specified.
Parameters
----------
callables : iterator
An iterator to a sequence of callables.
"""
func = next(iterator)