Skip to content

Instantly share code, notes, and snippets.

View wardpieters's full-sized avatar

Ward Pieters wardpieters

View GitHub Profile
@rrottmann
rrottmann / dist-upgrade-buster-to-bookworm.sh
Last active October 29, 2025 14:58
Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Debian 10
apt-get -y update
apt-get -y upgrade --without-new-pkgs
apt-get -y full-upgrade
cat > /etc/apt/sources.list <<"EOF"
deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/bullseye-security bullseye-security/updates main
deb-src http://security.debian.org/bullseye-security bullseye-security/updates main
@schube
schube / Apache vHost Config
Created March 27, 2021 16:53
Gitlab Registry on docker with reverse proxy
<VirtualHost *:443>
ServerAdmin info@mydomain.com
ServerName registry.mydomain.com
SSLEngine on
SSLCompression Off
SSLProtocol all -SSLv2 -SSLv3
SSLCertificateFile /etc/letsencrypt/live/registry.mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/registry.mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/registry.mydomain.com/fullchain.pem
@tomhicks
tomhicks / useTaskQueue.ts
Created January 11, 2021 11:41
React Hook for queueing and processing async tasks sequentially
function useTaskQueue(params: {
shouldProcess: boolean
}): {
tasks: ReadonlyArray<Task>
isProcessing: boolean
addTask: (task: Task) => void
} {
const [queue, setQueue] = React.useState<{
isProcessing: boolean
tasks: Array<Task>
@garethredfern
garethredfern / .env.github
Last active April 30, 2024 10:52
Github workflow for Laravel CI testing using a MYSQL database.
APP_ENV=ci
APP_KEY=
SESSION_DRIVER=array
CACHE_DRIVER=array
QUEUE_DRIVER=sync
MAIL_DRIVER=log

php7.0

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w php70w-opcache php70w-fpm php70w-common php70w-cli php70w-devel php70w-gd php70w-imap php70w-intl php70w-mbstring php70w-mcrypt php70w-mysqlnd php70w-pear 
yum install php70w-pecl-apcu php70w-pecl-memcached php70w-pecl-mongodb php70w-pecl-redis php70w-pecl-xdebug php70w-soap php70w-xmlrpc
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 1, 2025 14:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active September 20, 2025 22:27
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@cmwinters
cmwinters / gist:ecca9475b47d5937abd2
Created August 11, 2014 20:14
Evenly distribute space without flexbox

A lot of times I need to distribute nav-items or something in CSS, but the left and right items need to be flushed left and right and the space between all items needs to be evenly distributed.

Here are a few solutions I've come up with.

1. Use text-align: justify to evenly space items.
// JUSTIFIED LIST
.justified-list {
	margin:0;
@Emiel45
Emiel45 / ping_mc_1_7.php
Last active March 3, 2018 18:16
Minecraft 1.7 server list pinged (hacked together in 20 minutes)
<?php
// Info used: http://wiki.vg/Server_List_Ping
// (Original varint parsing: https://gist.github.com/thinkofname/e975ddee04e9c87faf22)
// Reads a varint from the socket
function read_varint($socket) {
$i = 0; $j = 0;
while(true) {
socket_recv($socket, $buf, 1, null);
$k = ord($buf[0]);
@daichan4649
daichan4649 / ProgressDialogFragment.java
Last active August 1, 2018 20:29
AsyncTask + ProgressDialogFragment (Android)
public class ProgressDialogFragment extends DialogFragment {
public final static String TITLE = "title";
public final static String MESSAGE = "message";
public final static String MAX = "max";
public final static String CANCELABLE = "cancelable";
public static ProgressDialogFragment newInstance() {
return new ProgressDialogFragment();
}