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
| #!/usr/bin/env bun | |
| // This script searches through the system PATH environment variable to locate Python installations | |
| // It checks each directory in PATH for both 'python' and 'python3' executables | |
| // When found, it prints the directory location and specific executable paths | |
| // This can help diagnose which Python versions are available and their resolution order | |
| // this script is written for bun - to run it use `bun run script.ts` | |
| // it should also be runnable with node using `npx tsx ./script.ts` |
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 { useEffect, useState } from "react"; | |
| enum NotificationError { | |
| ServiceWorkerAndPushManagerNotSupported = "ServiceWorkerAndPushManagerNotSupported", | |
| PushManagerUnavailable = "PushManagerUnavailable", | |
| ExistingSubscription = "ExistingSubscription", | |
| PermissionNotGranted = "PermissionNotGranted", | |
| } | |
| export function useNotifications() { |
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
| find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + |
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
| activate_pyenv() { | |
| if [[ -f ./.conda-env ]]; then | |
| env_name=$(cat ./.conda-env) | |
| conda activate "$env_name" | |
| ## This is to ensure that the python executable for conda is in the PATH and overrides any executables in | |
| python_executable_path=$(dirname $(which python)) | |
| ## add this to the front of the PATH | |
| export PATH="$python_executable_path:$PATH" | |
| fi |
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
| /** | |
| * Wait on a slow download page for Anna's archive and auto * click the Download button once it is ready | |
| */ | |
| function checkAndClickDownloadButton() { | |
| const intervalMs = 1000; | |
| let clicked = false; | |
| let intervalId; | |
| function check() { | |
| const btns = Array.from(document.getElementsByTagName("a")).filter( | |
| (ele) => ele.innerText === "Download now" |
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 os | |
| import json | |
| import pytz | |
| import redis | |
| import pickle | |
| import hashlib | |
| import datetime as dt | |
| from typing import Optional, Union | |
| from croniter import croniter | |
| from urllib.parse import urlparse |
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 { DateTime } from "luxon"; | |
| import { Page } from "puppeteer"; | |
| import { logger } from "./index"; | |
| import { sleep } from "./utils"; | |
| export async function goToEDFSearchPage( | |
| page: Page, | |
| start: string, | |
| end: string | |
| ) { |
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 { Icon, InlineIcon } from '@iconify/react'; | |
| import bxQuestionMark from '@iconify/icons-bx/bx-question-mark'; | |
| import { useState } from 'react'; | |
| import { Fade } from '@material-ui/core'; | |
| // mapping of language codes to shortcut strings | |
| const shortcuts = { | |
| en: [ | |
| { | |
| shortcut: 'CMD + K', |
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
| /** | |
| * InteractiveComponent - Easily trigger event handler binding | |
| * to instance context with a customizable method naming convention | |
| e.g. | |
| class Foo extends InteractiveComponent { | |
| onFooClickedHandler(event){ | |
| console.log('state', this.state) |
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
| var createChallenge = () => window.crypto.getRandomValues(new Uint8Array(32)).buffer; | |
| var createUserId = () => new Uint8Array(16); | |
| var credential; | |
| var attestation; | |
| var assertion; | |
| var createCredentialDefaultArgs = { | |
| publicKey: { | |
| rp: { name: "Dapper" }, |
NewerOlder