Skip to content

Instantly share code, notes, and snippets.

View gwpl's full-sized avatar

Grzegorz Wierzowiecki gwpl

  • Europe - usually: Zürich, Warsaw or Berlin
View GitHub Profile
@gwpl
gwpl / Test_backticks.md
Created December 17, 2023 10:01
Test backticks markdown
@gwpl
gwpl / Dockerfile
Created December 7, 2023 20:15
Nix on Alpine Dockerfile Helloworld
FROM alpine:latest
RUN apk add --no-cache curl xz
RUN addgroup -S nixbld && adduser -S -G nixbld nix
RUN mkdir -m 0755 /nix && chown nix /nix
USER nix
RUN curl -L https://nixos.org/nix/install | sh
ENV USER=nix
ENV PATH=/home/nix/.nix-profile/bin:$PATH
@gwpl
gwpl / gist:8faa1b314c7d5905dd23ce041d65dc79
Created November 28, 2023 00:07
Building docker and running custom entrypoint with `pytest` inside for aider
# https://github.com/paul-gauthier/aider or when working on a patch on fork:
docker build --file docker/Dockerfile -t aider-image .
# to launch pytest:
docker run -it --volume $(pwd):/app --entrypoint /bin/bash aider-image -c "pip install pytest && pytest"
@gwpl
gwpl / README.md
Last active November 27, 2023 22:29
Exploring multiple paths using git command line

Here I am exploring possiblities of uaing programmatically invoiced aider chat for exploration of graph conversations ala https://github.com/paradigmxyz/flux but in programmatic way.

Here we have log of

  • manual exploration
  • exploration of tree of possible conversationw with aider invoiced programmatically
    • and tracking .aider history
  • helpful script to display on cleared terminal aider history
@gwpl
gwpl / ftfy_line_by_line.py
Created May 25, 2017 14:08
Line by line encoding fixing using ftfy to Mojibake and other corrections ( ftfy: https://github.com/LuminosoInsight/python-ftfy )
#!/usr/bin/env python3
import ftfy, sys
with open(sys.argv[1], mode='rt', encoding='utf8', errors='replace') as f:
for line in f:
sys.stdout.buffer.write(ftfy.fix_text(line).encode('utf8', 'replace'))
#print(ftfy.fix_text(line).rstrip().decode(encoding="utf-8", errors="replace"))
@gwpl
gwpl / How to play linux default audio output on Sonos speakers (with delay using http streaming).md
Last active October 23, 2023 15:15
How to play linux default audio output on Sonos speakers (with delay using http mp3 or flac streaming)

how tu setup pulseaudio->streaming via cvlc (command line vlc -> so should simmilarily work with gui version (in my case don't)): https://superuser.com/a/1021823/81861

get pulseaudio source from list:

pactl list | grep "Monitor Source"

and assign to P , e.g. in my case it's usually:

# https://dev.to/mattdark/using-docker-as-provider-for-vagrant-10me
FROM ubuntu
ENV TZ=America/Mexico_City
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends ssh sudo
@gwpl
gwpl / Archlinux Vagrantfile = Docker + VirtualBox
Created September 11, 2023 11:40
Archlinux Vagrantfile = Docker + VirtualBox
$ cat Dockerfile
FROM archlinux:latest
# https://www.phind.com/agent?cache=clmesdgxc0008l108fa63vep6
# $ docker build -t my_archlinux .
RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm vim htop pv neovim rustup tmux screen
$ cat Vagrantfile
@gwpl
gwpl / Voting for portfolio distribution problem.md
Last active September 11, 2023 09:23
Voting Mechanisms and Weighted Analysis Dilemmas, for Portfolio, Crowdfundig, Majority overshadowing Problem and more.

Voting Mechanisms and Weighted Analysis Dilemmas, for Portfolio, Crowdfundig, Majority overshadowing Problem and more.

Tweet: https://twitter.com/GWierzowiecki/status/1701162675084947892

Introduction:

A decentralized system is envisioned wherein fractional owners of a portfolio contribute to decision-making regarding the distribution of funds among tokens. As a simple example, consider tokens named A, B, C, D...

@gwpl
gwpl / firefox_profile_X_KDE_launcher_as_foreground_window.sh
Last active July 15, 2023 17:32
KDE Foreground Window Launcher for Firefox Profiles: A bash script that temporarily disables KDE's Focus Steal Prevention, ensuring your chosen Firefox profile launches in the foreground with focus - perfect for keyboard shortcuts. This script is a product of a debugging session with OpenAI's GPT-4 AI model. See this conversation for a detailed …
#!/bin/bash
# KDE Foreground Window Launcher for Firefox Profiles:
# A bash script that temporarily disables KDE's Focus Steal Prevention,
# ensuring your chosen Firefox profile launches in the foreground
# with focus - perfect for keyboard shortcuts.
#
# Launch FireFox using specified profile
# while disabling KDE's FocusSealingPrevention feature temporarily
# so Firefox can open new window as Foreground and grab focus.