Skip to content

Instantly share code, notes, and snippets.

View AgainPsychoX's full-sized avatar

Patryk Ludwikowski AgainPsychoX

  • Poland
View GitHub Profile
@AgainPsychoX
AgainPsychoX / convert_sysincludes.py
Last active April 8, 2024 21:45
Disabling vendor (library/framework/not my code) warnings PlatformIO RP2040/Pico with Arduino earlephilhower core
# Script to help hide warnings from framework & libraries
# From https://community.platformio.org/t/silence-warnings-for-dependencies-external-libraries/33387/8
from pathlib import Path
import shlex
import sys
# PlatformIO injected stuff (I wish it was typed... https://github.com/platformio/platformio-docs/issues/342)
Import('env' ,'projenv') # type: ignore
env, projenv, DefaultEnvironment = env, projenv, DefaultEnvironment # type: ignore
@AgainPsychoX
AgainPsychoX / .ps1
Last active October 8, 2024 13:54
Sorting the same way Windows Explorer does
$array = @('1a2a5773', '0fe68296', '01b7f045')
$expected = @('0fe68296', '01b7f045', '1a2a5773')
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Write-Host 'Bad:' # from https://stackoverflow.com/a/5429048/4880243
$array | Sort-Object { [regex]::Replace($_, '\d+', { $args[0].Value.PadLeft(20) }) }
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@AgainPsychoX
AgainPsychoX / .css
Created May 3, 2023 11:40
Utility code to fix transition animations when closing HTML5 dialog
dialog {
margin: auto;
width: 100%;
min-width: 30vw;
min-height: 20vw;
border: none;
box-shadow: 0 0 16px -4px rgba(0, 0, 0, 0.7);
opacity: 0;
}

This is normal text.


This gets indented, without enumeration nor dots.

@AgainPsychoX
AgainPsychoX / PaintStyle.dart
Last active June 6, 2019 12:53
`PaintStyle` for `Paint` of `sky_engine`
import 'dart:ui';
/// A description of the style to use when drawing on a [Canvas].
///
/// Most APIs on [Canvas] take a [Paint] object to describe the style
/// to use for that operation. [PaintStyle] allows to be const
/// constructed and later in runtime forged into the [Paint] object.
class PaintStyle {
/// Whether to apply anti-aliasing to lines and images drawn on the
/// canvas.
@AgainPsychoX
AgainPsychoX / main.dart
Created May 29, 2019 14:25
Dart: Convert a `String` to a `Uint8List` and `Uint8List` to `String` (UTF-16)
import 'dart:typed_data';
void main() {
// Source
String source = 'Hello! Cześć! 你好! ご挨拶!Привет! ℌ𝔢𝔩𝔩𝔬! 🅗🅔🅛🅛🅞!';
print(source.length.toString() + ': "' + source + '" (' + source.runes.length.toString() + ')');
// String (Dart uses UTF-16) to bytes
var list = new List<int>();
import 'dart:typed_data';
void main() {
String source = 'Błonie';
List<int> list = source.codeUnits;
Uint8List bytes = Uint8List.fromList(list);
String outcome = String.fromCharCodes(bytes);
@AgainPsychoX
AgainPsychoX / automake-1-avoids-deprecated-syntax.patch
Created June 10, 2018 14:00
Patch for `automake` from `native` plugin of MXE, issue #2140
This file is part of MXE. See LICENSE.md for licensing information.
Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Patryk (PsychoX) Ludwikowski <[email protected]>
Date: Sun, 10 Jun 2018 06:49:41 +0000
Subject: [PATCH 1/1] Avoids deprecated syntax that causes failure in newer versions of Perl.
Contains patch for using too new Perl. Avoids deprecated syntax that causes failure in newer versions of Perl. More info at https://github.com/mxe/mxe/issues/2140
@AgainPsychoX
AgainPsychoX / Running `make --debug ffmpeg`
Last active June 10, 2018 01:49
Logs for issue with MXE: Package `ffmpeg` for `x86_64-w64-mingw32.static.posix` fails to build at `gnutls`
bash://PsychoX@PsychoX/mnt/e/Libraries/MXE/mxe
$ make --debug ffmpeg
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
@AgainPsychoX
AgainPsychoX / gist:53c08dbf93d5f3fbc3652dce8503f69e
Created September 10, 2017 23:01
MXE gettext fails (Ubuntu 14.04)
root@PSYCHOX:/mnt/e/Libraries/MXE/mxe# make
[check requirements]
[download] cmake
[build nonetwork lib]
[git-log] 0a829f9 Update packages.json & build-matrix.html
[build] cmake-conf x86_64-pc-linux-gnu
[done] cmake-conf x86_64-pc-linux-gnu 0 KiB 0m7.771s
[build] mxe-conf x86_64-pc-linux-gnu
[done] mxe-conf x86_64-pc-linux-gnu 308 KiB 0m12.753s
[build] cmake x86_64-pc-linux-gnu