Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#while true; do if [[ "$(hg pull --rebase https://hg.mozilla.org/mozilla-central)" != *"no changes found"* ]]; then if [ $? -eq 0 ]; then hg push try -f; else echo "manual merge required"; exit; fi; else echo "no changes found"; fi; sleep 600; done
while true; do
if [[ "$(hg pull --rebase https://hg.mozilla.org/mozilla-central)" != *"no changes found"* ]]; then
if [ $? -eq 0 ]; then
hg push try -f
else
echo "manual merge required"
@shanselman
shanselman / profile.json
Created May 7, 2019 04:22
Windows Terminal Profile
{
"defaultProfile": "{7d04ce37-c00f-43ac-ba47-992cb1393215}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"requestedTheme": "dark",
"profiles": [
{
@JustinGrote
JustinGrote / Search-Giphy.ps1
Last active March 3, 2025 19:00
Get a random gif from Giphy. ***NOTE: Invoke-TerminalGif was moved to MSTerminalSettings module***
#requires -module msterminalsettings,threadjob
###QUICKSTART
#FIRST: Run this in your Powershell Windows Terminal: Install-Module threadjob,msterminalsettings -scope currentuser
#THEN: iex (iwr git.io/invoketerminalgif)
#THEN: Get-Help Search-Giphy -Examples
#THEN: Get-Help Invoke-TerminalGif -Examples
#THEN: Search-Giphy | Format-List -prop *
#THEN: Invoke-TerminalGif https://media.giphy.com/media/g9582DNuQppxC/giphy.gif
foreach ($location in @('EastUS')) {
Get-AzVmSize -Location $location | % {
New-Object -TypeName PSobject -Property @{
Name = $_.Name;
NumberOfCores = $_.NumberOfCores;
MemoryInMB = $_.MemoryInMB;
MaxDataDiskCount = $_.MaxDataDiskCount;
OSDiskSizeInMB = $_.OSDiskSizeInMB;
ResourceDiskSizeInMB = $_.ResourceDiskSizeInMB;
Family = $(switch -regex ($_.Name) {
@asears
asears / Install-Apps.ps1
Last active February 26, 2024 13:37
Chocolatey Installs for a new Windows PC build (2020) - Don't run this, reference only.
# Run as Administrator in Powershell prompt
# Or better yet, don't do that
# https://chocolatey.org/
# Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Restart shell as administrator
# Restart pc after each install requiring restart.
choco feature enable -n allowGlobalConfirmation
# Sudo for Windows (Run as Administrator in command prompt)
# Chocolatey installs are run as admin
#!/bin/bash
# git clone https://github.com/shawwn/stylegan2 -b tpu
source "$HOME/bin/activate-tf1"
set -x
#export TPU_NAME=grpc://0.tcp.ngrok.io:15992
export TPU_NAME=grpc://0.tcp.ngrok.io:17042
export GCE_BUCKET=gs://sgappa-multi/stylegan-encoder
# git clone https://github.com/NVlabs/stylegan2
import os
import numpy as np
from scipy.interpolate import interp1d
from scipy.io import wavfile
import matplotlib.pyplot as plt
import PIL.Image
import moviepy.editor
import dnnlib
'''
YouTube FileStorage v0.0
requires: ffmpeg, youtube-dl
'''
import os
import shutil
import sys
import numpy as np
from scipy.spatial import cKDTree
@kentcdodds
kentcdodds / package.json
Last active September 28, 2025 07:49
setup script for my workshops
{
"name": "workshop-setup",
"version": "1.0.0",
"description": "This is the common setup script for most of my workshops",
"bin": "./setup.js"
}
$subscription = 'dd0d4271-9b26-4c37-a025-1284a43a4385';
$observations = @{};
foreach ($resourceGroupName in @('taskcluster-staging-workers-us-central')) {
$observations[$resourceGroupName] = @{};
while (($vms = @(Get-AzVm -ResourceGroupName $resourceGroupName -Status)) -or ($vms.Length -gt 0)) {
Write-Output -InputObject ('{0} virtual machines observed in {1}' -f $vms.Length, $resourceGroupName);
foreach ($vm in $vms) {
$name = $vm.Name;
if (-not $observations[$resourceGroupName].ContainsKey($name)) {
$observations[$resourceGroupName][$name] = @{};