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 | |
| # A script to terminate an EC2 instance and remove its local SSH config entry. | |
| # --- Configuration --- | |
| SSH_CONFIG_FILE="$HOME/.ssh/config" | |
| # Exit script if any command fails. | |
| set -e |
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 | |
| # A script to launch an EC2 instance and add it to your SSH config. | |
| # --- Configuration --- | |
| # The name of your SSH key pair as it appears in AWS. | |
| KEY_NAME="<KEY_NAME>" | |
| # The path to your private SSH key file. | |
| # This script assumes it is in ~/.ssh/ and has a .pem extension. | |
| KEY_PATH="$HOME/.ssh/${KEY_NAME}.pem" |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Decibel Threshold Demonstrator</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/tone/14.7.77/Tone.js"></script> | |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"> | |
| <style> |
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
| def torch_determinism_pls(seed: int): | |
| np.random.seed(seed) # if you're using numpy | |
| torch.manual_seed(seed) | |
| torch.cuda.manual_seed_all(seed) | |
| torch.use_deterministic_algorithms(True) | |
| torch.utils.deterministic.fill_uninitialized_memory(True) |
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
| import asyncio | |
| from concurrent.futures import ThreadPoolExecutor | |
| from typing import AsyncIterator, Iterator | |
| import queue | |
| def compute_intensive_generator() -> Iterator[int]: | |
| """Example compute-bound generator that yields numbers.""" | |
| result = 0 | |
| for i in range(10): | |
| # Simulate heavy computation |
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
| """ | |
| ARC implementation | |
| Based on | |
| http://code.activestate.com/recipes/576532-adaptive-replacement-cache-in-python/ | |
| Original Paper | |
| https://www.usenix.org/legacy/events/fast03/tech/full_papers/megiddo/megiddo.pdf | |
| Warning: patented by IBM |
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
| module.exports = async (params) => { | |
| const activeFile = this.app.workspace.getActiveFile(); | |
| if (!activeFile) return; | |
| // Get the current frontmatter | |
| const metadata = this.app.metadataCache.getFileCache(activeFile); | |
| let frontmatter = metadata?.frontmatter || {}; | |
| // Update the finished date - store as a Date object | |
| const now = new Date() |
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
| javascript:(function(){const prefix='_ytPlayerContainer_';let toggleCount=0;document.querySelectorAll('*').forEach(el=>{el.classList.forEach(cls=>{if(cls.startsWith(prefix)){el.style.display=el.style.display==='none'?%27%27:%27none%27;toggleCount++;return;}});});console.log(`Toggled display for ${toggleCount} element(s) with classes starting with "${prefix}".`);})(); |
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
| """ | |
| Using torchrun to create a process per GPU, we shard the data accordingly and each | |
| torchrun process spins up a Dask LocalCluster to process the data in parallel to | |
| maximise GPU utilisation. | |
| """ | |
| import os | |
| from typing import Any, Iterator, Sequence, TypeVar | |
| import socket | |
| import orjson |
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
| # coding: utf-8 | |
| import click | |
| import torchaudio as ta | |
| import torch | |
| import librosa | |
| from pesq import pesq | |
| MAX_WAV_VALUE = 32768.0 | |
| @click.command() |
NewerOlder