Skip to content

Instantly share code, notes, and snippets.


GP paambaati

View GitHub Profile
swinton /
Last active May 12, 2022
Automatically sign your commits from GitHub Actions, using the REST API

Verified commits made easy with GitHub Actions


So you want to commit changes generated by a GitHub Actions workflow back to your repo, and have that commit signed automatically?

Here's one way this is possible, using the REST API, the auto-generated GITHUB_TOKEN, and the GitHub CLI, gh, which is pre-installed on GitHub's hosted Actions runners.

You don't have to configure the git client, just add a step like the one below... Be sure to edit FILE_TO_COMMIT and DESTINATION_BRANCH to suit your needs.

franky47 / use100vh.js
Created Jan 11, 2020
React hook to fix the 100vh issue on mobile Chrome and Safari
View use100vh.js
import React from 'react';
import { useWindowSize } from 'react-use';
// 100vh is broken on mobile (Chrome, Safari):
export default function use100vh() {
const ref = React.useRef();
const { height } = useWindowSize();
View haproxy-config-2-0.cfg
# This is the ultimate HAProxy 2.0 "Getting Started" config
# It demonstrates many of the features available which are now available
# While you may not need all of these things, this can serve
# as a reference for your own configurations.
# Have questions? Check out our community Slack:
gricard /
Last active Jun 3, 2021
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here:

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
marwei /
Created Nov 9, 2017
How to Reset Kafka Consumer Group Offset

Kafka (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
Luzifer /
Last active Mar 9, 2022
Running docker-compose as a systemd service

Running docker-compose as a systemd service


File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
miry /
Last active Jun 21, 2019
Change ubuntu hostname with Terraform. `terraform apply -target=null_resource.set-hostname`
variable "server_ip" {
default = ""
variable "server_hostname" {
default = "node01"
# Ubuntu reference for hostnamectl:
resource "null_resource" "set-hostname" {

Aligning images

left alignment

This is the code you need to align images to the left:

bastman /
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

justmoon / custom-error.js
Last active May 19, 2022 — forked from subfuzion/
Creating custom Error classes in Node.js
View custom-error.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor); =;
this.message = message;
this.extra = extra;
require('util').inherits(module.exports, Error);