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 / 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 / BashMelodies.sh
Last active December 22, 2023 10:44
BashMelodies: - Musical Bash!
#!/bin/bash
#
# 🎶 Just transformed #Bash into a musical instrument with a little help from an AI!
# Check out this cool script that plays melodies using simple commands. 🤖🎵
# PS: Wouldn't have explored this without the AI insights. Here's our chat:
# https://chat.openai.com/share/60aa47f0-3793-47f7-a8d8-f2a14ee04747
#
# Run as script
# Or source into your shell "source BashMelodies.sh" and call functions directly!
# 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.
@gwpl
gwpl / .bashrc
Last active June 27, 2023 08:30
Bash Log using PROMPT_COMMAND with `start_logging` and `stop_logging` for .bashrc
# Add to .bashrc to have bash logging that you can enable and disable:
# Credits to GPT-4 and also for you to learn how to prompt to get such nice output
# https://chat.openai.com/share/14882663-6e4c-4699-85bd-5296a18deb06
# Define the function to log commands
log_command() {
# Get the timestamp
local timestamp=$(date "+%Y-%m-%d %H:%M:%S")
# Get the exit code
@gwpl
gwpl / .git_hooks_post-commit
Created April 27, 2023 18:51
Automatically pushing main branch to multiple repositories after each commit
# cat .git/hooks/post-commit # <= change this file in your repo to automatiicaly execute after each commit
#!/bin/bash
cd /path/to/your/repo
git push gitlab master && git push github master && git push anotherserver master
# You may want to add your different remotes using:
# git remote add REMOTENAME git@server.domain:group/project.git #this is ssh example
# (and REMOTENAME above was gitlab, github, anotherserver...)
@gwpl
gwpl / clean_Ink_printer_CMYK_heads.tex
Created April 21, 2023 09:49
Clean Ink CMYK printer heads with color pages.
\documentclass{article}
\usepackage{xcolor}
\usepackage{geometry}
\geometry{paperwidth=21cm,paperheight=29.7cm,margin=0cm}
\definecolor{cyan}{RGB}{0,255,255}
\definecolor{magenta}{RGB}{255,0,255}
\definecolor{yellow}{RGB}{255,255,0}
\begin{document}
@gwpl
gwpl / rust_session_illustrate_value_change_in_vector.bash_terminal
Last active March 6, 2023 21:20
Rust session Illustrate Value change in vector
#If you run in terminal multiplexxer...
# (or code editor and terminal to see complile+run output)
# like screen or tmux,
# you may want in one to have
$ $EDITOR l1.rs
# and in another:
echo l1.rs | entr -cs 'rustc l1.rs && ./l1'