Skip to content

Instantly share code, notes, and snippets.

@ernstki
ernstki / gitlapi
Last active November 23, 2024 18:48
Query GitLab v4 API endpoints with curl and jq; handles record pagination
#!/usr/bin/env bash
##
## Query a GitLab v4 API endpoint, with pagination
##
## Author: Kevin Ernst <ernstki -at- mail.uc.edu>
## License: ISC or WTFPL, at your discretion
## Date: 22 May 2024
## Requires: jq (https://github.com/jqlang/jq)
## Homepage: https://gist.github.com/ernstki/3707675c8a4ddb06d128154947c49e29
##
@mikeller
mikeller / gitlab_remove_expired_artifacts_by_group.py
Last active February 7, 2025 13:41
gitlab_remove_expired_artifacts_by_group.py
#!/usr/bin/env python3
import time
import requests
import sys
from datetime import datetime, timezone
from dateutil import parser
import re
def print_stderr(*args, **kwargs):
@FreddieOliveira
FreddieOliveira / docker.md
Last active February 19, 2025 08:11
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active February 19, 2025 18:58
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

@craigvantonder
craigvantonder / flush-dns.sh
Last active February 3, 2021 04:42
Flushing the DNS in Ubuntu 16.04
#!/bin/bash
# NB: First install nscd with sudo apt-get install nscd
# run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart
# or use:
sudo /etc/init.d/networking force-reload
# Flush nscd dns cache:
sudo /etc/init.d/nscd restart
@efrecon
efrecon / run.tpl
Last active February 4, 2025 13:12
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}
@bennylope
bennylope / ansible.yml
Created April 30, 2014 00:35
Deployment w/ Capistrano style deployments with Ansible & Capistrano
---
- name: Deploy new site release
user: deployer
hosts: all
tasks:
- name: Fetch repo updates
git: >
repo=git@github.com:my/repo.git
@ftrain
ftrain / rhymes.clj
Last active July 14, 2023 22:20
Annotated rhyming dictionary
;; This is at: https://gist.github.com/8655399
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;;
;; https://gist.github.com/jackrusher/8640437
;;
;; I'm going to study this code and learn as I go.
;;
;; First I put it in a namespace.
@jbenet
jbenet / simple-git-branching-model.md
Last active January 13, 2025 08:27
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@nachocab
nachocab / instructions.sh
Last active February 13, 2022 15:45
How to make git diff work perfectly with .docx files in Mac OS X (it even colors by word)
# download docx2txt by Sandeep Kumar
wget -O docx2txt.pl http://www.cs.indiana.edu/~kinzler/home/binp/docx2txt
# make a wrapper
echo '#!/bin/bash
docx2txt.pl $1 -' > docx2txt
chmod +x docx2txt
# make sure docx2txt.pl and docx2txt are your current PATH. Here's a guide
http://shapeshed.com/using_custom_shell_scripts_on_osx_or_linux/