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
| -S res,ext:mp4:m4a --recode mp4 |
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
| class WorkHour(int, Enum): | |
| WORK_START = 8 | |
| LUNCH_START = 12 | |
| LUNCH_END = 13 | |
| WORK_END = 17 | |
| def is_working_hour(self) -> bool: | |
| t = date.time() | |
| morning_ok = time(WorkHour.WORK_START.value, 0) <= t < time(WorkHour.LUNCH_START.value, 0) | |
| afternoon_ok = time(WorkHour.LUNCH_END.value, 0) <= t < time(WorkHour.WORK_END.value, 0) |
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}" |
NewerOlder