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
## Universal | |
- nmol/L -> pmol/L = 1000 | |
- pmol/L -> nmol/L = 0.001 | |
- ng/mL -> ng/dL = 100 | |
- ng/dL -> ng/mL = 0.01 | |
- ng/mL -> pg/mL = 1000 | |
- pg/mL -> ng/mL = 0.001 | |
## Hormone specific |
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 argparse | |
import os | |
import re | |
import subprocess | |
import sys | |
from pathlib import Path | |
def repo_root() -> Path: | |
return Path(__file__).resolve().parent |
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
// Clone trait | |
// structs by default don't allow cloning, if we add this trait we can allow it and implement an alternative fix to this | |
#[derive(Debug, Clone)] | |
struct Order { | |
name: String, | |
year: u32, | |
made_by_phone: bool, | |
made_by_mobile: bool, | |
made_by_email: bool, |
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 dfs(obj, key) -> dict | list | None: | |
""" | |
Finds an item and returns values | |
Args: | |
obj (dict | list): object | |
key (str): target key | |
Returns: | |
dict | list | None | |
""" | |
# Handle dicts |
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 * as React from "react"; | |
import { Moon, Sun } from "lucide-react"; | |
import { Button } from "@/components/ui/button"; // shadcn button | |
export function ModeToggle() { | |
const [theme, setThemeState] = React.useState<"light" | "dark">("light"); | |
// Initialize theme from localStorage or DOM | |
React.useEffect(() => { |
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
--- | |
description: "Use shadcn/ui components as needed for any UI code" | |
patterns: "*.tsx" | |
--- | |
# Shadcn UI Components | |
This project uses @shadcn/ui for UI components. These are beautifully designed, accessible components that you can copy and paste into your apps. | |
## Finding and Using Components |
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
// 1) Abre el diálogo de compartir | |
const openBtn = document.querySelector('div[role="button"][aria-label="Send this to friends or post it on your profile."]'); | |
if (openBtn) { | |
const e1 = new MouseEvent('click', {bubbles: true, cancelable: true, view: window}); | |
openBtn.dispatchEvent(e1); | |
// 2) Espera un momento a que aparezca el botón “Share now” | |
setTimeout(() => { | |
const shareBtn = document.querySelector('div[role="button"][aria-label="Share now"]'); | |
if (shareBtn) { | |
const e2 = new MouseEvent('click', {bubbles: true, cancelable: true, view: window}); |
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
from stem import Signal | |
from stem.control import Controller | |
import requests | |
class TorController: | |
def __init__(self, control_port=9051): | |
self.control_port = control_port | |
self.local_ip = f"127.0.0.1{control_port}" |
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
function processSpintax(text) { | |
// Define the regex that captures the innermost { ... } | |
const regex = /\{([^{}]+)\}/; | |
// Keep going while the text still matches { ... } | |
while (regex.test(text)) { | |
text = text.replace(regex, (match, contents) => { | |
// Split the contents by "|" | |
const parts = contents.split('|'); | |
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 this in the browser console on any profile's timeline page | |
(async function() { | |
// Set to store unique tweets | |
let tweetsSet = new Set(); | |
let scrollAttempts = 0; | |
const maxScrollAttempts = 5; // Number of times to try scrolling without new tweets before stopping | |
// Function to sleep for a given time (in milliseconds) | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); |