Skip to content

Instantly share code, notes, and snippets.

View berndverst's full-sized avatar

Bernd Verst berndverst

View GitHub Profile
@berndverst
berndverst / README.md
Created October 6, 2022 20:29
Update PR remote branch checked out via Github CLI (gh pr checkout)

Compendium function for updating PRs checked out via GitHub CLI

This script is called updatePR.

Usage:

gh pr checkout 1234
# make some changes
updatePR 1234
@berndverst
berndverst / Readme.md
Created August 26, 2022 21:01
GitHub CLI helper for OSS maintainers to update/fixup PRs from contributors

GitHub (GH) CLI helper script to update Pull Requests (PRs) from contributors.

As a maintainer of an OSS project I constantly find myself having to fix up incoming PRs. I enjoy using the GitHub CLI, but unfortunately this CLI does not provide an easy way to identify the remote fork the PR originated from.

As a result my git remote -v lists a lot of remotes that I had to manually add after viewing the PR in my browser to obtain the remote clone URL. This is not sustainable. Git allows pushing to a remote URL directly, so there is no need to define the remote before hand.

This script defines a utility functions that makes it easy for gh GitHub CLI users to update contributions.

@berndverst
berndverst / copilot example.md
Created June 29, 2021 16:46
Simple Copilot Example

Existing code:

import requests


def get_hacker_news_stories_by_search_term(search_term: str):
    """
    Get the stories from Hacker News mentioning the search term.
 """
@berndverst
berndverst / Live Coding Music Workshop.md
Last active January 11, 2021 02:41
Workshop: Creating Music through Live Coding

Creating Music through Live Coding

Author: Bernd Verst

In this workshop we will use the Sonic Pi live coding synthesizer to create part of an iconic song, live. We'll be creating the repeating four bar / measure phrase of the opening song to Hamilton, Alexander Hamilton.

Participation is strongly encouraged. A note on accessibility: Unfortunately this workshop relies on the participant / learner to receive immediate feedback via audio. Hearing impaired participation is possible and correctness of a piece of music can be achieved, but will be less enjoyable.

Prerequisites

You need to install Sonic Pi from here: https://sonic-pi.net/

@berndverst
berndverst / # openjdk - 2020-10-05_23-44-13.txt
Created October 6, 2020 06:47
openjdk on Ubuntu 20.04.1 LTS - Homebrew build logs
Homebrew build logs for openjdk on Ubuntu 20.04.1 LTS
Build date: 2020-10-05 23:44:13
@berndverst
berndverst / organize-functions.sh
Last active June 25, 2020 22:51
Shell (Bash, ZSH) functions for easily organizing media files and documents on MacOS and Linux
# Example use:
# cd ~/Downloads
# mvmedia .
# mvdocs .
#
# Intended to be used for MacOS, but can be used on Linux if destination folders are altered.
# Simply save this file and source in your .zshrc, .bash_profile, .bashrc etc
mvimages() {
DESTINATION="$HOME/Pictures/"
@berndverst
berndverst / trimvideoinstantly.sh
Last active April 4, 2020 00:00
Trimming videos instantly without reencoding using FFmpeg
INFILE="video.mp4"
OUTFILE="shortenedclip.mp4"
START="00:00:12.35" # Start Time in hh:mm:ss.msec format
DURATION="00:01:05.4" # Duration in hh:mm:ss.msec format
################## Alternative format ##################
# START="12.35" # Start time in s.msec format #
# DURATION="65.4" # Duration time in s.msec format #
########################################################
@berndverst
berndverst / Readme.md
Last active March 29, 2024 09:27
Script to quickly merge captions into mp4 H.264 (or HEVC/H.265) video as selectable or burned in subtitles from command-line

Add captions to MP4 videos as subtitles

Requirements

FFMpeg must be installed.

Instructions:

@berndverst
berndverst / convert.py
Created April 2, 2020 00:36
Convert Subtitles in WebVTT format exported from Microsoft Stream to SRT
# Conversion of Microsoft Stream WebVTT file to SRT
# Takes advantage of specific metadata structure in Microsoft Stream VTT files
vtt = open('INPUT.vtt','r')
vtt_iter = iter(vtt)
with open('OUTPUT.srt', 'w') as srt:
counter = 1
next(vtt_iter)
for line in vtt_iter:
@berndverst
berndverst / hackcbs-workshop.md
Last active December 23, 2022 07:53
hackCBS 2.0: Using Azure + AI to detect Emotion

hackCBS 2.0: Using Azure + AI to detect Emotion

This Hackathon is designed for beginners. No prior experience is necessary.

Azure provides powerful AI tools, wrapped up in APIs that you can use from your apps to add intelligence without being an AI expert. In this hands-on workshop you will build a Python app that takes advantage of one of these APIs to detect emotions in faces, alerting you if you have a sad face too often. This app will be in two parts, one part that runs on the desktop and takes photos, and another that runs in the cloud to analyse photos and store the emotions detected.

Required resources

  • Python 3.7 runtime (not the latest 3.8 as not all required libraries are available yet). We recommend Python 3.7.4 for this workshop. Download
  • Microsoft Azure Account (Azure Portal)
  • Don't have one? Sign up for [Azure for Students](https://azure.mic