Skip to content

Instantly share code, notes, and snippets.

View gotdibbs's full-sized avatar
:shipit:
doing things

William Dibbern gotdibbs

:shipit:
doing things
View GitHub Profile
@gotdibbs
gotdibbs / chia-move-plots.ps1
Last active July 24, 2021 14:36
Hacky utility scripts for Chia on Windows
# Safely move chia plots from one drive to another on Windows
$SOURCE_DIR = 'A:\Chia'
$DEST_DIR = 'B:\Chia'
$move_count = 0;
while (($plot_to_move = (Get-ChildItem $SOURCE_DIR -Filter '*.plot' | Select-Object -First 1)) -ne $null) {
$old_name = $plot_to_move.Name
# Temporarily rename the plot before moving https://github.com/Chia-Network/chia-blockchain/wiki/Moving-plots
@gotdibbs
gotdibbs / convert.ps1
Last active March 8, 2021 23:59
Convert mp4 to h.265
# Assumes all videos are in a folder called "video" sitting alongside ffmpeg
# Note conversion is likely lossy, but not noticeable in my experience and the >50% space savings were worth it to me personally
# See more detailed notes below for tuning and options
$videosToConvert = Get-ChildItem -Filter '*.mp4'
foreach ($video in $videosToConvert) {
$destination = Join-Path 'output' $video.Name
If ((Test-Path -Path $destination -PathType Leaf) -ne $true) {
@gotdibbs
gotdibbs / gist:63a298ab0752fa9a7185d00e8b76efff
Created April 25, 2020 16:16
Mocking chainable APIs in Javascript, ex. mocking `useFirestore` from `react-redux-firebase`
let firestoreDefinition = {
collection: {
doc: {
get: true,
set: true,
update: true,
destroy: true
}
},
batch: {
@gotdibbs
gotdibbs / webapi.js
Created February 1, 2017 17:55
Web API, seriously?
var activity = {
subject: subject
};
activity[['regardingobjectid_', _entityName, '_task@odata.bind'].join('')] =
['/', entitySetName, '(', Guid.decapsulate(entityId), ')'].join('');
@gotdibbs
gotdibbs / copy-spotlight.cmd
Created October 30, 2016 20:18
Copy Windows Spotlight Images
@echo off
title "Copying Spotlight Images..."
mkdir Spotlight
xcopy %localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\*.* Spotlight\
ren Spotlight\*.* *.jpg
@gotdibbs
gotdibbs / keybase.md
Created April 17, 2015 16:23
keybase.md

Keybase proof

I hereby claim:

  • I am gotdibbs on github.
  • I am gotdibbs (https://keybase.io/gotdibbs) on keybase.
  • I have a public key whose fingerprint is 94E8 6A21 8AA2 882F FBB8 C559 ABA8 E423 39DF B401

To claim this, I am signing this object:

@gotdibbs
gotdibbs / orgquery.sql
Last active December 19, 2015 00:39
Check users against MSCRM_CONFIG database for invalid user id error #sql #crm
use [ORGANIZATIONNAME_MSCRM];
select crm.FullName
from SystemUser crm
where crm.IsDisabled = 0
and not exists
(
select crm.SystemUserId
from MSCRM_CONFIG.dbo.SystemUserOrganizations config
join MSCRM_CONFIG.dbo.Organization org