Skip to content

Instantly share code, notes, and snippets.

View sonjz's full-sized avatar

Jason Huggins sonjz

  • ReCollect, a Routeware Company
  • Nova Scotia
View GitHub Profile
@wataruoguchi
wataruoguchi / RefactoringChapter2.md
Created January 31, 2021 21:31
Refactoring - Chapter 2: Principles in Refactoring

Refactoring

Chapter 2: Principles in Refactoring

The previous chapter explained what refactoring is. This chapter is about some of the principles.

Defining Refactoring

  • Refactoring (noun): a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behaviour.
  • Refactoring (verb): to restructure software by applying a series of refactorings without changing its observable behaviour.
@wataruoguchi
wataruoguchi / RefactoringChapter1.md
Created January 22, 2021 17:46
Refactoring - Chapter 1: Refactoring: A First Example

Refactoring

Chapter 1: Refactoring: A First Example

The Starting Point

Comments on the Starting Program

... when I change the system, there is a human involved, and humans do care.

@geerlingguy
geerlingguy / ansible-role-test.sh
Last active January 18, 2024 17:37
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@JonCole
JonCole / Redis-BestPractices-General.md
Last active April 27, 2024 12:50
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@JonCole
JonCole / DiagnoseRedisErrors-ClientSide.md
Last active January 6, 2020 17:52
Diagnosing Redis errors caused by issues on the client side
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@acook
acook / keypress.rb
Created December 2, 2012 18:42
Read keypresses from user in terminal, including arrow keys using pure Ruby. This has since been folded into a much more robust gem called Remedy. https://rubygems.org/gems/remedy & https://github.com/acook/remedy
require 'io/console'
# Reads keypresses from the user including 2 and 3 escape character sequences.
def read_char
STDIN.echo = false
STDIN.raw!
input = STDIN.getc.chr
if input == "\e" then
input << STDIN.read_nonblock(3) rescue nil
@mrublev
mrublev / How to run a seconds SSHd on Mac OS X.txt
Created July 20, 2012 09:22 — forked from MacLemon/How to run a seconds SSHd on Mac OS X.txt
Instructions for an alternative port SSH server on Mac OS X (without Bonjour annoucements).
Alternative/Secondary/Backup SSH Service:
Add this line to /etc/services
ssh-alt 10022/tcp # ssh-alternative
You may change the port to any unused port you like but maybe try to avoid 2222 and 22222 as they are a little too obvious. This line actually specifies which port your alternative sshd will be listening on.
Save the launchd item following as as /Library/LaunchDaemons/ssh-alt.plist
Load with
# SSH Agent Functions
# Mark Embling (http://www.markembling.info/)
#
# How to use:
# - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice)
# - Import into your profile.ps1:
# e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes]
# - Enjoy
#
# Note: ensure you have ssh and ssh-agent available on your path, from Git's Unix tools or Cygwin.