Skip to content

Instantly share code, notes, and snippets.

View chrisshroba's full-sized avatar

Christopher Shroba chrisshroba

View GitHub Profile
@fnky
fnky / ANSI.md
Last active April 24, 2024 03:46
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: 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

@HaleTom
HaleTom / print256colours.sh
Last active April 14, 2024 13:35
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@romainl
romainl / colorscheme-override.md
Last active April 6, 2024 22:42
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Generalities first

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@TooTallNate
TooTallNate / mouse.js
Created January 30, 2012 05:55
Enable "mouse reporting" with Node.js
// Based on:
// http://groups.google.com/group/nodejs-dev/browse_thread/thread/a0c23008029e5fa7
process.stdin.resume();
process.stdin.on('data', function (b) {
var s = b.toString('utf8');
if (s === '\u0003') {
console.error('Ctrl+C');
process.stdin.pause();
@sheldonh
sheldonh / local_wait.yml
Last active July 27, 2023 21:02
Wait for SSH to come up in an Ansible playbook
---
- hosts: demo
tags: wait
gather_facts: no
tasks:
- name: Wait for SSH
local_action: wait_for port=22 host={% if ansible_ssh_host is defined %}{{ ansible_ssh_host }}{% else %}{{ inventory_hostname }}{% endif %}
-- Description:
-- ------------
--
-- This is an example schema for storing collectd metrics in a TimescaleDB
-- dabase (see https://www.timescale.com/). It is based on the PostgreSQL
-- schema contributed by Sebastian Harl.
--
-- Prerequisities:
-- ---------------
--
@bartj3
bartj3 / .tmux.conf
Created March 25, 2015 11:35
Hide tmux status bar when zoomed in on a pane
bind-key z resize-pane -Z \; if-shell "tmux list-panes -F '#F' | grep -q Z" "set -g status off" "set -g status on"
@drmalex07
drmalex07 / play-with-reboot-and-wait.yml
Last active August 9, 2018 16:01
An example of rebooting all hosts and waiting in an Ansible playbook. #ansible #ansible-playbook #reboot
---
- hosts: all
vars:
tasks:
- name: Echo hostname
shell: echo {{ansible_host}}
- name: Reboot