Skip to content

Instantly share code, notes, and snippets.

@technic
technic / README.md
Last active October 27, 2022 23:11
change font linespacing for dummy editor #linux #ttf #qtcreator

How to change font linespacing

Manual

You need to manipulate a ttf file. I found such a script that comes with Input font at http://input.fontbureau.com. So we copy DejaVuSansMono ttf files to ~/.fonts/ and create a new font DejaVuSansMonoH. I changed line 147, to match this font name, and run

@technic
technic / set-tags-magic.ipynb
Created February 8, 2019 12:32
jupyter magic to manipulate notebook tags
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@technic
technic / info.hpp
Created February 5, 2022 20:36
AppInfo hacks
#pragma once
#include <filesystem>
#include <fstream>
#include <giomm/desktopappinfo.h>
#include <glibmm/keyfile.h>
#include <fmt/core.h>
#include <spdlog/spdlog.h>
#include "util/string.hpp"
#include "util/format.hpp"
#include <variant>
#include <type_traits>
#include <iostream>
#include <string>
template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
template<typename T>
struct wrapper {
@technic
technic / impossible-case-bug.idr
Created June 28, 2021 16:08
Demonstration of issue in idris2
module Main
import Data.Vect
||| View for splitting a vector in half, non-recursively
public export
data Split : Vect n a -> Type where
SplitNil : Split []
SplitOne : Split [x]
||| two non-empty parts
SplitPair : {n : Nat} -> {m : Nat} ->
@technic
technic / custom.ui
Created November 2, 2020 18:54
LyX export toolbar button
# -*- text -*-
# file default.ui
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
# author John Levon
# Full author contact details are available in file CREDITS.
@technic
technic / doit_completion.ps1
Last active September 6, 2020 20:51
Draft of powershell Tab completion for pydoit
# doit completion
function WriteLog([string] $Message) {
$timestamp = Get-Date -Format HH:mm:ss
"[$timestamp] $Message" | Out-File -Append "${env:Home}\tablog.txt"
}
Register-ArgumentCompleter -CommandName doit -Native -ScriptBlock {
param(
[String] $wordToComplete,
@technic
technic / README.md
Created October 28, 2019 16:40
oh-my-posh workaround

The old winpty has a bug, when running terminal in VS Code: after executing MinGW command escape sequencies are broken.

We can disable those by modifying theme file in a following way

    if ($env:ConEmuANSI -eq "ON") {
        $prompt += Set-CursorForRightBlockWrite -textLength ($timestamp.Length + 1)
        $prompt += Write-Prompt $timeStamp -ForegroundColor $sl.Colors.PromptForegroundColor    
 }
@technic
technic / .bashrc
Last active October 25, 2019 10:04
Powershell profile
# ssh-agent
check-ssh-agent() {
test -S "$SSH_AUTH_SOCK" && {
ssh-add -l >& /dev/null
if [ $? -ne 2 ]; then
echo "ssh-agent is already running ($SSH_AUTH_SOCK)"
true
else
false
fi
@technic
technic / README.md
Last active September 19, 2019 06:40
Fast rust implementation for https://habr.com/ru/post/450512, reference C++ and Go implementations also present