Skip to content

Instantly share code, notes, and snippets.

View trey's full-sized avatar
🏠
I'd rather be at home

Trey Piepmeier trey

🏠
I'd rather be at home
View GitHub Profile
@angela-d
angela-d / gpg-key-migration.md
Created April 1, 2018 23:57
Move GPG Keys from One Machine to Another

Migrate GPG Keys from One Workstation to Another

Replace [your key] with your key ID

To obtain your key ID

gpg --list-secret-keys --keyid-format LONG

Which returns something like

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 22, 2024 16:30
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active April 23, 2024 15:35
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@Integralist
Integralist / aspect_ratio.py
Last active September 22, 2023 18:18
[Calculate Aspect Ratio] #aspect #ratio #python
def calculate_aspect(width: int, height: int) -> str:
def gcd(a, b):
"""The GCD (greatest common divisor) is the highest number that evenly divides both width and height."""
return a if b == 0 else gcd(b, a % b)
r = gcd(width, height)
x = int(width / r)
y = int(height / r)
return f"{x}:{y}"
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active March 12, 2024 15:59 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@alopresto
alopresto / gpg_git_signing.md
Last active January 18, 2024 22:42
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@hal0gen
hal0gen / _mobile-ready-web-app.html
Last active April 7, 2024 09:33 — forked from tfausak/ios-8-web-app.html
iOS + Android settings for web applications
<!doctype html>
<!-- Adapted from https://gist.github.com/tfausak/2222823 -->
<html>
<head>
<title>Mobile-ready web app</title>
<!-- CONFIGURATION -->
@elijahmanor
elijahmanor / readme.text
Last active May 28, 2020 13:07
My GitHub Atom Packages
atom-beautify@0.28.21
atom-css-comb@3.0.0
caniuse@0.9.0
easy-motion-redux@1.0.0
editorconfig@1.2.4
emmet@2.4.1
git-blame@0.4.8
git-plus@5.12.1
git-time-machine@1.2.3
jscs-fixer@1.0.2
# =======================================
# OS X — ONE CLICK — EJECT ALL DISKS
# =======================================
# Open Script Editor on OS X
# Copy and paste this file in
# Pre-High Sierra: Save As > Application
# High Sierra: Export > File Format > Application
# Name it "Eject All Disks"
# Drag created application to Dock
# Now you can eject all external disks with one click from Dock