Skip to content

Instantly share code, notes, and snippets.

Avatar
🇨🇦

Steven Black StevenBlack

🇨🇦
View GitHub Profile
@StevenBlack
StevenBlack / 100bytes.css
Created Jun 18, 2022
Between 100 and 200 bytes of solid css.
View 100bytes.css
// source: https://www.swyx.io/css-100-bytes
html {
max-width: 70ch;
padding: 3em 1em;
margin: auto;
line-height: 1.75;
font-size: 1.25em;
}
h1,h2,h3,h4,h5,h6 {
@StevenBlack
StevenBlack / 1M-TLD.md
Created Jun 16, 2022
Top 1-million domains TLD breakdown
View 1M-TLD.md

See the conversation here: StevenBlack/hosts#1956

$ ghosts --tld -m /Users/steve/Downloads/top-1m.txt   

----------------------------------------
Base hosts file summary:
----------------------------------------
Location: /Users/steve/Downloads/top-1m.txt
Domains: 999,295
@StevenBlack
StevenBlack / pullall.sh
Last active Apr 16, 2022
git pull in all sub directories
View pullall.sh
# Run "git pull" in each subdirectory of the current directory.
# Useful when you store all of your git repos in one folder.
clear
for dir in ./*; # For every item in the folder:
do (
if [ -d "$dir" ]; # If it is a directory:
then (
echo "$dir" && # Print the path,
@StevenBlack
StevenBlack / shtdn.bat
Created Feb 11, 2022
Shutdown a remote network machine
View shtdn.bat
shutdown -r -m \\MachineName -t -0
@StevenBlack
StevenBlack / elapsed.rs
Created Jan 25, 2022
Rust elapsed time
View elapsed.rs
use std::time::Instant;
let start = Instant::now();
let mut lines: Vec<String> = self.raw_list.clone();
println!("clone {}", start.elapsed().as_millis());
@StevenBlack
StevenBlack / named_colors.sql
Last active Jan 17, 2022
Several hundred named colors with hex codes.
View named_colors.sql
-- collected from various sources on the web.
select * from (
('Absolute zero','#0048BA'),
('Acid green','#B0BF1A'),
('Aero','#7CB9E8'),
('Aero blue','#C9FFE5'),
('African violet','#B284BE'),
('Air Force blue (RAF)','#5D8AA8'),
('Air Force blue (USAF)','#00308F'),
@StevenBlack
StevenBlack / 1-setup.md
Created Nov 16, 2021 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra
View 1-setup.md

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

View semantic-commit-messages.md

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

View OpenSSL Cheatsheet.md

General OpenSSL Commands

These commands allow you to generate CSRs, Certificates, Private Keys and do other miscellaneous tasks.

  • Generate a new private key and Certificate Signing Request
openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
  • Generate a self-signed certificate (see How to Create and Install an Apache Self Signed Certificate for more info)