Skip to content

Instantly share code, notes, and snippets.

View jeremyrsellars's full-sized avatar

Jeremy R. Sellars jeremyrsellars

  • Liberty, MO, USA
View GitHub Profile
@jeremyrsellars
jeremyrsellars / ClipVideo.ps1
Created January 12, 2023 05:15
Clip YT audio
# Downloads the video and coverts to audio, then clips it from $start to $stop time and saves as $file
# The time formats must be "hh:mm:ss" and are relative to the beginning of the source video.
$youtubeUrl = "https://www.youtube.com/watch?v=T6SyM0Kw6GA"
$start = "00:00:36"
$stop = "00:04:55"
$file = "clip"
$youtube_id = [regex]::new("[^/=]+$").Match($youtubeUrl).Value
md $youtube_id -ErrorAction SilentlyContinue
cd $youtube_id
@jeremyrsellars
jeremyrsellars / core.matrix-cheatsheet.md
Last active August 15, 2019 13:17
core.matrix Cheatsheet

Core Matrix Cheatsheet

  • An attempt to categorize operations by their effect on the shape of the data.

Apply to all elements (unary)

  • abs
  • acos
  • asin
  • atan
  • cbrt (cubed-root)
  • ceil
@jeremyrsellars
jeremyrsellars / UserConfiguration.json
Last active January 28, 2019 01:14
UHK User Configuration
{
"userConfigMajorVersion": 4,
"userConfigMinorVersion": 0,
"userConfigPatchVersion": 0,
"deviceName": "My UHK",
"doubleTapSwitchLayerTimeout": 250,
"iconsAndLayerTextsBrightness": 255,
"alphanumericSegmentsBrightness": 255,
"keyBacklightBrightness": 255,
"mouseMoveInitialSpeed": 4,
using System;
using System.Threading;
namespace Sellars.Functional.Fluent
{
static class FunctionalExtensions
{
/// <summary>
/// Creates a <see cref="Lazy{T}"/> from <see cref="valueFactory"/>.
/// </summary>
@jeremyrsellars
jeremyrsellars / AProgram.cs
Last active January 17, 2023 09:05
Thread-safety of ConcurrentDictionary vs. Dictionary
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Text.RegularExpressions;
using System.Linq;
using System.Threading;
using static System.Console;
using Microsoft.FSharp.Core;
using Microsoft.FSharp.Collections;
@jeremyrsellars
jeremyrsellars / clojure_socket_repl.r
Created April 30, 2016 22:27
R-clojure socket repl interop experiments
# java -cp \clojure-1.8.0\clojure-1.8.0.jar -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl :bind-err false}" clojure.main
# I had to change keyprefix/suffix from looking like a keyword
# to being a string because keywords don't support spaces well.
# Original:
## key_prefix <- ":"
## key_suffix <- ""
# Todo: Technically, might want to escape quotes in "named lists".
@jeremyrsellars
jeremyrsellars / Affinitize.cs
Created February 6, 2016 22:11
Affinitizer
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Management;
using System.Text;
using System.Text.RegularExpressions;
using System.ComponentModel;
static class Program
@jeremyrsellars
jeremyrsellars / .editorconfig
Last active May 22, 2017 15:27
CSharp Code Guidelines
# editorconfig.org
# top-most EditorConfig file
root = true
# Default settings:
# A newline ending every file
# Use 2 spaces as indentation
# Trim trailing whitespace
[*]
@jeremyrsellars
jeremyrsellars / keybase.md
Created March 22, 2015 03:28
Keybase authenticity

Keybase proof

I hereby claim:

  • I am jeremyrsellars on github.
  • I am jeremyrsellars (https://keybase.io/jeremyrsellars) on keybase.
  • I have a public key whose fingerprint is 7D4C CA95 6ACC 7520 3EB9 6140 C46F AE49 D274 822A

To claim this, I am signing this object:

@jeremyrsellars
jeremyrsellars / configure_git.cmd
Last active August 29, 2015 14:16
Git configuration script a la http://gitimmersion.com/lab_11.html. Adds GPG signing options.
:: Credit to http://gitimmersion.com/lab_11.html
:: This is useful when you don't care to know where your .gitconfig is.
:: git hist
git config --global --add alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global --add alias.co "checkout"
git config --global --add alias.ci "commit"
git config --global --add alias.cm "commit -m"