Skip to content

Instantly share code, notes, and snippets.

View Programazing's full-sized avatar
🏳️‍⚧️

Christopher C. Johnson Programazing

🏳️‍⚧️
View GitHub Profile
@Programazing
Programazing / Tampermonkey-YouTube-Transcript-Extractor.txt
Created April 18, 2025 19:18
Tampermonkey YouTube Transcript Extractor - Extracts YouTube transcripts to the clipboard
// ==UserScript==
// @name YouTube Transcript Extractor
// @namespace http://tampermonkey.net/
// @version 1.9
// @description Extracts YouTube transcripts to the clipboard
// @author Programazing
// @match https://www.youtube.com/watch?v=*
// @grant none
// ==/UserScript==
@Programazing
Programazing / toggle_dnd.sh
Created November 5, 2024 19:38
A handy way to toggle Do Not Disturb in Gnome
#!/bin/bash
# Get the current Do Not Disturb status
current_status=$(gsettings get org.gnome.desktop.notifications show-banners)
# Toggle the status
if [ "$current_status" = "true" ]; then
gsettings set org.gnome.desktop.notifications show-banners false
echo "Do Not Disturb mode activated"
else
@Programazing
Programazing / .bashrc
Last active August 3, 2024 16:57
Flatpak Install Script
alias generateFlatpakScript="~/generate_flatpak_install_script.sh"
# Navigation
alias a='nano ~/.bash_aliases'
alias ae='gedit ~/.bash_aliases'
alias ..='cd ..'
alias ...='cd ../..'
alias todev='cd /media/programazing/Documents/Dev'
alias toproj='cd /media/programazing/Documents/Dev/personal/projects'
# cloneproj linkToGitRepo
@Programazing
Programazing / Alphabet.cs
Last active April 12, 2025 11:57
A simple way to generate the English Alphabet in C#
// IEnumerable<char> Lowercase
var alphabet = Enumerable.Range('a', 26).Select(n => (char)n);
// IEnumerable<char> Uppercase
var alphabet = Enumerable.Range('A', 26).Select(n => (char)n);
// IEnumerable<string> Lowercase
var alphabet = Enumerable.Range('a', 26).Select(n => ((char)n).ToString());
{"lastUpload":"2019-12-29T17:56:40.049Z","extensionVersion":"v3.4.3"}
@Programazing
Programazing / ToDataTable
Created April 18, 2019 15:38
An extension method to convert a List of any type to a DataTable.
public static DataTable ToDataTable<T>(this List<T> input)
{
var props = TypeDescriptor.GetProperties(typeof(T));
var output = new DataTable();
foreach(PropertyDescriptor item in props)
{
if (item.PropertyType.IsGenericType && item.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>))
output.Columns.Add(item.Name, item.PropertyType.GetGenericArguments()[0]);
else
using Xunit;
namespace FizzBuzzChecker.Test
{
public class FizzBuzzTests
{
[InlineData(3, "Fizz")]
[InlineData(6, "Fizz")]
[InlineData(9, "Fizz")]
[InlineData(12, "Fizz")]
var book = (from theBook in _context.Books.Where(b => b.BookId == id)
join loan in _context.BookLoans.Where(x => !x.ReturnedOn.HasValue) on theBook.BookId equals loan.BookID into result
from loanWithDefault in result.DefaultIfEmpty()
select new BookDetailsViewModel
{
BookID = theBook.BookId,
SubTitle = theBook.SubTitle,
Title = theBook.Title,
Author = theBook.Author,
ISBN = theBook.ISBN,