Skip to content

Instantly share code, notes, and snippets.

View x100ex's full-sized avatar

Aleksander A. Popov x100ex

View GitHub Profile
@x100ex
x100ex / zk-id-uqns-ck.py
Created December 31, 2020 14:32
Zettelkasten identifiers uniqueness check
#!/usr/bin/env python3
# Zettelkasten identifiers uniqueness check
import os, pathlib, re
"""
Find and print non-unique Zettelkasten identifiers
"""
def find_and_print_nnuqzkid(workdir):
--- a/cmake/MacApp.cmake
+++ b/cmake/MacApp.cmake
@@ -67,7 +67,6 @@
ADD_CUSTOM_TARGET(signed_fish_macapp
DEPENDS fish_macapp "${MACAPP_ENTITLEMENTS}"
COMMAND codesign --force --deep
- --options runtime
--entitlements "${MACAPP_ENTITLEMENTS}"
--sign "${MAC_CODESIGN_ID}"
$<TARGET_BUNDLE_DIR:fish_macapp>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -173,7 +173,7 @@
ADD_CUSTOM_COMMAND(
TARGET ${target}
POST_BUILD
- COMMAND codesign --force --deep --options runtime --sign "${MAC_CODESIGN_ID}" $<TARGET_FILE:${target}>
+ COMMAND codesign --force --deep --sign "${MAC_CODESIGN_ID}" $<TARGET_FILE:${target}>
VERBATIM
)
@x100ex
x100ex / icu4c.rb
Created September 20, 2020 15:51
patched homebrew formula to install icu4c on macos 10.12.6
class Icu4c < Formula
desc "C/C++ and Java libraries for Unicode and globalization"
homepage "http://site.icu-project.org/home"
url "https://github.com/unicode-org/icu/releases/download/release-67-1/icu4c-67_1-src.tgz"
version "67.1"
sha256 "94a80cd6f251a53bd2a997f6f1b5ac6653fe791dfab66e1eb0227740fb86d5dc"
license "ICU"
livecheck do
url "https://github.com/unicode-org/icu/releases/latest"
@x100ex
x100ex / create-mut-copy.cc
Created June 19, 2017 07:15
мутабельная копия константного объекта
// Copyright (C) 2017, Aleksander A. Popov.
//
// Создание копии константного объекта при необходимости использования
// ссылки или указателя на мутабельный объект
//
template <typename T>
class CreateMutCopy {
T copy_;
@x100ex
x100ex / valid-pixels-rect-calc.cc
Last active June 19, 2017 07:15
вычисление габаритов корректных пикселей
// Copyright (C) 2017, Aleksander A. Popov.
//
// Вычисление габаритов корректных пикселей
// одновременно с расчётом этих пикселей
//
#include <QRect>
std::pair<int, int> find_nonzero_range(const std::vector<int>& v) {
@x100ex
x100ex / matrix-rect-subsampling.cc
Last active June 19, 2017 07:15
прореживание сетки пикселей и сетки тайлов
// Copyright (C) 2017, Aleksander A. Popov.
//
// Функции прореживания сетки пикселей и сетки тайлов
//
#include <QRect>
QRect subsample_erosion_twice(const QRect& rc) {
return rc.isValid() ? QRect(QPoint(rc.left() / 2, rc.top() / 2),
@x100ex
x100ex / ccassert.h
Created June 17, 2017 09:39
static assert in C
// C compiler check for structure size
// from: http://bytes.com/topic/c/answers/220022-if-sizeof
#define _x_CCASERT_LINE_CAT(predicate, line) typedef char constraint_violated_on_line_##line[2*((predicate) != 0)-1];
#define CCASSERT(predicate) _x_CCASERT_LINE_CAT(predicate, __LINE__)
// Usage: CCASSERT(1) to pass; CCASSERT(0) to fail
/*
typedef struct {
long x;
@x100ex
x100ex / README-default.md
Created June 17, 2017 09:37
template of the README.md file

Logo of the project

Name of the project

Additional information or tagline

A brief description of your project, what it is used for and how does life get awesome when someone starts to use it.

Installing / Getting started

Keybase proof

I hereby claim:

  • I am x100ex on github.
  • I am aap (https://keybase.io/aap) on keybase.
  • I have a public key ASCXWEe4dEfsXVnNXx4O2jgcow0kN0RRM_PHw5NhPL8Rlgo

To claim this, I am signing this object: