❯ cat ~/.wezterm.lua
-- Pull in the wezterm API
local wezterm = require("wezterm")
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
function og() { open $(git config --get remote.origin.url | sed 's/git@\(.*\):\(.*\)\.git/https:\/\/\1\/\2/g') }
#!/bin/bash
# Open the repo in the browser
function og() {
open "$(git config --get remote.origin.url | sed 's/git@\(.*\):\(.*\)\.git/https:\/\/\1\/\2/g')"
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Disable pager | |
export GH_PAGER=cat | |
# Usage: ./failed_steps.sh <workflow_name_or_id> <repo_owner/repo_name> | |
WORKFLOW_NAME="$1" | |
REPO="$2" |
Last updated March 13, 2024
This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.
Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.
For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set your GitHub personal access token (Use a fine-grained PAT with "actions: read" permission) | |
GITHUB_TOKEN="your_personal_access_token" | |
OWNER="your_github_username_or_org" | |
REPO="your_repository_name" | |
# Get the latest workflow run ID | |
RUN_ID=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "Accept: application/vnd.github.v3+json" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Print most frequent N-grams in given file. | |
Usage: python ngrams.py filename | |
Problem description: Build a tool which receives a corpus of text, | |
analyses it and reports the top 10 most frequent bigrams, trigrams, | |
four-grams (i.e. most frequently occurring two, three and four word | |
consecutive combinations). | |
NOTES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2025-01-16T04:34:05.2325283Z Current runner version: '2.321.0' | |
\u001b[36m Sample ANSI message \u001b[0m | |
2025-01-16T04:34:05.2325283Z Current runner version: '2.321.0' | |
[32m[INFO][0m Application started successfully. | |
[33m[WARN][0m Configuration file not found, using defaults. | |
[31m[ERROR][0m Failed to connect to the database. | |
[34m[DEBUG][0m Processing request ID: 12345. | |
[32m[INFO][0m User 'admin' logged in. | |
[33m[WARN][0m Disk usage is above 80%. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import yaml | |
from pathlib import Path | |
import argparse | |
def find_called_workflows(file_path): | |
"""Parse a workflow file to find referenced workflows.""" | |
called_workflows = set() | |
with open(file_path, "r") as f: | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from datetime import datetime | |
def prepend_diff(input_file, output_file): | |
# Read all lines from the input file | |
with open(input_file, 'r') as file: | |
lines = file.readlines() | |
output_lines = [] | |
prev_timestamp = None |
Tutorial and tips for GitHub Actions workflows
NewerOlder