Skip to content

Instantly share code, notes, and snippets.

@deerwood-mccord-jr
deerwood-mccord-jr / boxstarter.ps1
Created May 7, 2023 13:44 — forked from ghostinthewires/boxstarter.ps1
Boxstarter Commands for a new Windows machine.
# Description: Boxstarter Script
# Author: https://twitter.com/GhostInTheWire5
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
# NOTE the "." above is required.
#
# Run this boxstarter by calling the following from **elevated** powershell:
# example: Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/ghostinthewires/033276015ba9d58d1f162e7fd47cdbd3/raw/boxstarter.ps1 -DisableReboots
# Learn more: http://boxstarter.org/Learn/WebLauncher
@deerwood-mccord-jr
deerwood-mccord-jr / vscode-macos-context-menu.md
Created February 9, 2023 19:14 — forked from idleberg/vscode-macos-context-menu.md
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@deerwood-mccord-jr
deerwood-mccord-jr / GuiMultiLineTextField
Created February 5, 2023 20:43 — forked from Draco18s/GuiMultiLineTextField
A multiline text entry box for Minecraft's GUI system
package com.draco18s.runic.client.gui;
import java.util.ArrayList;
import org.lwjgl.input.Mouse;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import net.minecraft.client.Minecraft;
@deerwood-mccord-jr
deerwood-mccord-jr / Extensions.InvariantString.cs
Created September 12, 2022 02:21 — forked from sandrock/Extensions.InvariantString.cs
C# Returns an invariant, roundtrip-safe string representation numeric values
namespace System
{
using System.Globalization;
// source: https://gist.github.com/sandrock/6fe3298b8ac6d9d0d9872dd811a63908
/// <summary>
/// Extension methods for common types that provide ToInvariantString() capability.
/// </summary>
@deerwood-mccord-jr
deerwood-mccord-jr / git-maven-howto.md
Created September 4, 2021 13:36 — forked from fernandezpablo85/git-maven-howto.md
how to create your own maven repository on github

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone git@github.com:ORGANIZATION/PROJECT.git my-repository

Cd into it

@deerwood-mccord-jr
deerwood-mccord-jr / gist:b47aa18f5424048646c371591d313192
Created July 21, 2021 22:37 — forked from metaskills/gist:893599
A Copy Of sp_MSforeachtable Stored Procedure For Azure, Uses sp_MSforeach_worker
CREATE proc [dbo].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
AS
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)
@deerwood-mccord-jr
deerwood-mccord-jr / git-extract-file.markdown
Created December 13, 2020 15:40 — forked from ssp/git-extract-file.markdown
Extract a single file from a git repository

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch

@deerwood-mccord-jr
deerwood-mccord-jr / atom-macos-context-menu.md
Created November 30, 2020 01:06 — forked from idleberg/atom-macos-context-menu.md
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@deerwood-mccord-jr
deerwood-mccord-jr / convert-and-split.sh
Created November 29, 2020 01:09 — forked from a-r-d/convert-and-split.sh
How to take an annoying APE + CUE file cd rip and convert it into a set of FLAC or MP3 files on ubuntu.
#first install all the things:
sudo apt-get install flac ffmpeg mp3splt libav-tools shntool
# Okay first lets do an MP3:
# input files:
# --> cd.ape
# --> cp.cue
# (there are other options, like bitrate, but this is just the bare bones)
avconv -i cd.ape cd.mp3
@deerwood-mccord-jr
deerwood-mccord-jr / AsOfWiqlQueryToFixIterationPath.ps1
Created September 2, 2020 11:59 — forked from pietergheysens/AsOfWiqlQueryToFixIterationPath.ps1
Fix Iteration Path of work items based on values of the as of parameter in a Azure DevOps WIQL query
$token = ""
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f "azdo",$token)))
$uri = "https://dev.azure.com/{organisation}/{teamproject}/_apis/wit/wiql?api-version=5.1"
$body = @"
{
"query": "Select [System.Id], [System.Title], [System.State] From WorkItems
Where [System.TeamProject] = {teamproject} AND [System.WorkItemType] <> 'Test Case'
asof '2020-01-08T10:00:00.000Z'"}