Skip to content

Instantly share code, notes, and snippets.

@ryanpcmcquen
ryanpcmcquen / darkify_slack.sh
Last active August 27, 2025 07:48
Darkify your Slack.
#!/bin/sh
# Darkify Slack on Mac OS or Linux.
# curl https://gist.githubusercontent.com/ryanpcmcquen/8a7ddc72460eca0dc1f2dc389674dde1/raw/darkify_slack.sh | sh
if [ "`uname -s`" = "Darwin" ]; then
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/dist/ssb-interop.bundle.js"
else
SLACK_INTEROP_JS="/usr/lib/slack/resources/app.asar.unpacked/dist/ssb-interop.bundle.js"
fi
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active March 11, 2026 09:01
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@bvis
bvis / Jenkinsfile
Last active January 5, 2026 21:30
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@RichardBronosky
RichardBronosky / README.MD
Last active March 5, 2026 14:28
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@lfepp
lfepp / recurring_maintenance_windows.py
Last active June 26, 2025 08:49
Script to create a number of recurring maintenance windows in PagerDuty
#!/usr/bin/env python
#
# Copyright (c) 2016, PagerDuty, Inc. <info@pagerduty.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active February 27, 2026 11:52
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@julienbourdeau
julienbourdeau / commit-message-convention.md
Created May 2, 2016 12:02
The seven rules of a great git commit message

Source: http://chris.beams.io/posts/git-commit/#seven-rules

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active December 8, 2025 01:48
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@tobiasmh
tobiasmh / gist:3e5aa4f7a37d9e834647
Last active August 21, 2018 18:31
Migrate a Confluence users activity to another user
-- WARNING
-- WARNING THIS IS PROBABLY INCOMPLETE AND MAY BREAK CONFLUENCE. USE AT YOUR OWN RISK
-- WARNING
-- Migrate a Confluence users activity to another user
SELECT * FROM user_mapping WHERE lower_username='old_username' OR lower_username='new_username';
+----------------------------------+------------------+----------------+
| user_key | username | lower_username |
+----------------------------------+------------------+----------------+
| ff8080814094fe77014094ffd60c0115 | old_username | old_username |
@acdha
acdha / non-latin digits.py
Last active April 28, 2017 17:23
Gist demonstrating Unicode-awareness in Python's concept of what a digit is
#/usr/bin/env python
# encoding: utf-8
from __future__ import print_function, unicode_literals
import re
import sys
def safe_call(func, *args, **kwargs):
try:
return func(*args, **kwargs)