Skip to content

Instantly share code, notes, and snippets.

@AlexCzar
AlexCzar / dropdown_tabbed_alacrity.sh
Last active Jul 22, 2021
Tabbed DropDown Alacritty for X11
View dropdown_tabbed_alacrity.sh
#!/bin/sh
# Author: https://github.com/AlexCzar
# License: Apache 2.0
# This script can be used as a launcher for alacritty-inside-tabbed
# It monitors window manager events and when detects that tabbed has
# lost focus, script will minimize tabbed.
# If alacritty-in-tabbed is not running, it will launch it, if it is
# running but isn't focused, script will give it focus, if it is running
# and is focused, script will minimize it.
@fernandoaleman
fernandoaleman / mysql2-catalina.md
Last active Sep 9, 2021
Install mysql2 on MacOS Catalina
View mysql2-catalina.md

Problem

Installing mysql2 gem errors on MacOS Catalina with MySQL 5.7.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@amanbolat
amanbolat / task.yml
Created Jan 6, 2020
Use ansible to download latest github release assets
View task.yml
- name: Get assets
get_url:
url: "https://api.github.com/repos/{{ username }}/{{ repo_name }}/releases/latest?access_token={{ github_token }}"
force: yes
headers:
Accept: "application/vnd.github.v3+json"
dest: "/tmp/{{ assets_response }}"
- name: Get download url
shell: |
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active Sep 22, 2021
Use a Git commit message template to write better commit messages
View git-commit-template.md

Using Git Commit Message Templates to Write Better Commit Messages

One of my colleagues shared an article on writing (good) Git commit messages today: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@sarthology
sarthology / regexCheatsheet.js
Created Jan 10, 2019
A regex cheatsheet 👩🏻‍💻 (by Catherine)
View regexCheatsheet.js
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@matthewpalmer
matthewpalmer / nfs-server.yaml
Created Oct 22, 2018
Example for NFS server in Kubernetes
View nfs-server.yaml
# Note - an NFS server isn't really a Kubernetes
# concept. We're just creating it in Kubernetes
# for illustration and convenience. In practice,
# it might be run in some other system.
# Create a service to expose the NFS server
# to pods inside the cluster.
kind: Service
apiVersion: v1
@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active Sep 21, 2021
Install mysql2 on MacOS Mojave
View mysql2-mojave.md

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@alexanderadam
alexanderadam / Ansible Disk Check
Created Sep 15, 2018 — forked from mahemoff/Ansible Disk Check
Show disk space and warn about disk full in Ansible
View Ansible Disk Check
* Shows a message while asserting like:
ok: [host] => {
"msg": "disk usage 4.2B of total 20.0GB (21.0%) (should exceed limit 90.0%)"
}
* Note this only looks at first mount point on current node
* Fails if disk is near-full
* Last step pushes to a push-based monitoring service, which will alert us if it doesn't get there after some time
* Need to setup a variable `disk_limit`, which is the max acceptable usage ratio, e.g. set it to 0.8 if you want to keep disks within 80% of max size
@Ocramius
Ocramius / Caddyfile
Last active Jun 4, 2021
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
View Caddyfile
:80 {
root /serve
}
@melozo
melozo / daemon.json
Created Jun 12, 2018
Example Docker daemon.json
View daemon.json
{
"api-cors-header": "",
"authorization-plugins": [],
"bip": "",
"bridge": "",
"cgroup-parent": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"debug": true,