Preprocessing
This file contains hidden or 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
| ''' | |
| YouTube FileStorage v0.0 | |
| requires: ffmpeg, youtube-dl | |
| ''' | |
| import os | |
| import shutil | |
| import sys | |
| import numpy as np | |
| from scipy.spatial import cKDTree |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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 | |
| # 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 |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| 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) { |
This file contains hidden or 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
| #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 |
This file contains hidden or 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
| { | |
| "defaultProfile": "{7d04ce37-c00f-43ac-ba47-992cb1393215}", | |
| "initialRows": 30, | |
| "initialCols": 120, | |
| "alwaysShowTabs": true, | |
| "showTerminalTitleInTitlebar": true, | |
| "experimental_showTabsInTitlebar": true, | |
| "requestedTheme": "dark", | |
| "profiles": [ | |
| { |
This file contains hidden or 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 | |
| #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" |
This file contains hidden or 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
| { | |
| "python": { | |
| "library": "import json\ndef black_reformat(cell_text):\n import black\n import re\n cell_text = re.sub('^%', '#%#', cell_text, flags=re.M)\n try:\n reformated_text = black.format_str(cell_text, 88)\n except TypeError:\n reformated_text = black.format_str(cell_text, mode=black.FileMode(line_length=88))\n return re.sub('^#%#', '%', reformated_text, flags=re.M)", | |
| "prefix": "print(json.dumps(black_reformat(u", | |
| "postfix": ")))" | |
| }, | |
| "r": { | |
| "library": "library(formatR)\nlibrary(jsonlite)", | |
| "prefix": "cat(toJSON(paste(tidy_source(text=", | |
| "postfix": ", output=FALSE)[['text.tidy']], collapse='\n')))" |