This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING: NON-WORKING CODE - DO NOT USE IN PRODUCTION! | |
#TODO: Implement $AppName & $MainWindowHandle parameters | |
function Set-WindowState { | |
<# | |
.SYNOPSIS | |
Set a given window state using WinAPI. | |
.DESCRIPTION | |
Use the ShowWindowAsync function to set the Window state for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To download and install, run this command in PowerShell: | |
# PowerShell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/JamesDBartlett3/40d4459e39402cbc30a73731e310a27c/raw/'))" | |
#Install WinGet | |
#Based on this gist: https://gist.github.com/Codebytes/29bf18015f6e93fca9421df73c6e512c | |
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller' | |
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") { | |
"Installing winget Dependencies" | |
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference for updates: https://gist.github.com/NicolaiSoeborg/df8fd374e94cbadedb0902858c1354c2 | |
javascript: (function () { | |
function c() { | |
var e = document.createElement("link"); | |
e.setAttribute("type", "text/css"); | |
e.setAttribute("rel", "stylesheet"); | |
e.setAttribute("href", f); | |
e.setAttribute("class", l); | |
document.body.appendChild(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Tar and compress files using tqdm or pv for a progress bar. | |
# * Safety | |
# NOTE: These are disabled by default in this template but should be | |
# enabled when feasible. Documentation is from the Bash man page. | |
# ** errexit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#shamelessly copied from here https://discuss.pytorch.org/t/utility-function-for-calculating-the-shape-of-a-conv-output/11173/7 | |
# original docs at https://pytorch.org/docs/master/nn.html#conv2d | |
import math | |
def num2tuple(num): | |
return num if isinstance(num, tuple) else (num, num) | |
def conv2d_output_shape(h_w, kernel_size=1, stride=1, pad=0, dilation=1): | |
h_w, kernel_size, stride, pad, dilation = num2tuple(h_w), \ |