Skip to content

Instantly share code, notes, and snippets.

View Wirone's full-sized avatar
🇯🇲
Feel the chill

Greg Korba Wirone

🇯🇲
Feel the chill
View GitHub Profile
@Wirone
Wirone / _linearize_git_history.md
Last active August 21, 2025 07:56
Linearize Git history while preserving authorship (more or less) from merged branches

This gist shows how you can linearize complex Git tree that has many merge commits, making it like a "squash on merge" policy was used from the beginning of repo's history, while modifying commits' authorship in a standardised way.

It checks if a commit is a merge commit and, if so, modifies its author and parents:

  • merge commit becomes "regular" commit with only 1 parent
  • authorship for ex-merge commit is taken from the last commit of merged branch (2nd parent that is discarded). It assumes that single person was working on a branch, so it may produce false blame information if multiple people authored commits in a branch (all changes from the branch have authorship from last commit's author). In our case it was needed because merge commits are automated and authorship comes from bot user, so without
@Wirone
Wirone / Pie-PHP.Dockerfile
Last active November 26, 2024 18:17
Using PIE (Extensions Installer for PHP) in Docker builds
FROM php:8.4-cli AS php-debian
RUN apt-get -q update \
# Pie requires ZIP extension to be installed (checked with Box requirements when executing Pie's PHAR)
&& apt-get -yq install gnupg libzip-dev libzip4 \
&& docker-php-ext-install zip \
# Official docs includes one-liner that uses `latest` release, but URL gives 404.
# Anyway, it's probably better to use fixed version of Pie to have stable builds.
&& curl -L --output /usr/bin/pie https://github.com/php/pie/releases/download/0.2.0/pie.phar \
&& chmod +x /usr/bin/pie \
@Wirone
Wirone / compose.yml
Created May 8, 2024 13:46
Kafka replacement after `wurstmeister` disappeared from Docker Hub
# See: https://quay.io/repository/strimzi/kafka
# See: https://github.com/wurstmeister/zookeeper-docker/issues/31
services:
kafka:
image: quay.io/strimzi/kafka:${KAFKA_VERSION:-0.32.0-kafka-3.3.1}
command: [
"sh", "-c",
"bin/kafka-server-start.sh config/server.properties --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}"
]
@Wirone
Wirone / imagick-3.7.0-failed-install-on-docker-PHP-8.3-build.txt
Last active January 16, 2025 21:54
Imagick 3.7.0 failed installation on PHP 8.3.2
Built on Docker with php:8.3.2-fpm-bullseye as a base image
Prerequisites installed: libmagickwand-dev, libmagickwand-6.q16-6
FYI: Same dependencies work properly on PHP 8.2.10
-----
326.0 downloading imagick-3.7.0.tgz ...
326.0 Starting to download imagick-3.7.0.tgz (360,138 bytes)
326.0 .........................................................................done: 360,138 bytes
@Wirone
Wirone / .gpg with agent for Git commit signing
Last active March 16, 2018 07:21
GPG key and agent for Git commit signing
This is working mix of information found on the Internet.
Most tutorials mention obsolete --write-env-file,
so I use simple eval with whole output redirected to /dev/null
in order to silently spawn GPG agent daemon.
Had to use test command mentioned above so GPG asked for key's passphrase (only once).
Got this working on:
- Kubuntu 16.04
@Wirone
Wirone / Chrome history: select all
Last active March 16, 2018 07:24
Simple script for selecting all items on Chrome's browsing history
// Select all results in chrome://history-frame/
Array.prototype.slice.call(document.getElementsByTagName('input'))
.forEach(function(inp) {
if(inp.type != 'checkbox') { return; }
inp.checked = true;
});
@Wirone
Wirone / .gitconfig
Last active July 16, 2023 15:57
GIT & GitFlow aliases for ~/.gitconfig
# GIT aliases for ~/.gitconfig file
# @author Grzegorz Korba <[email protected]>
# Credits: Miscellaneous places on the Internet...
# GitFlow related sections
[gitflow "branch"]
master = master
develop = develop
[gitflow "prefix"]
feature = feature/
@Wirone
Wirone / page.html
Created February 17, 2014 11:27
CasperJS onbeforeunload: not catched alert issue
<!DOCTYPE html>
<html>
<head>
<title>CasperJS - onbeforeunload issue</title>
<meta name="author" value="Grzegorz 'Wirone' Korba" />
<script type="text/javascript">alert('Just alerting...');</script>
</head>
<body>
<h1>Page without onbeforeunload</h1>
<a class="next" href="page_onbeforeunload.html">Next</a>