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
alias: Reminder for Medication | |
description: Sends reminders to take medication at a specific time and notifies when medication is not taken. | |
domain: automation | |
input: | |
reminder_time: | |
name: Reminder Time | |
description: The time to send the medication reminder | |
selector: | |
time: {} | |
door_sensor: |
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 dotenv | |
dotenv.load_dotenv() | |
import sys | |
import os | |
import openai | |
openai.api_key = os.environ['OPENAI_KEY'] | |
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 transformers import AutoTokenizer | |
import requests | |
import argparse | |
import os | |
from dotenv import load_dotenv | |
from pathlib import Path | |
def call_llm(model, headers, prompt, end_instruction): | |
API_URL = f"https://api-inference.huggingface.co/models/{model}" | |
payload = { |
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 subprocess | |
import psutil | |
def get_ports_for_pid(pid): | |
ports = [] | |
try: | |
for conn in psutil.Process(int(pid)).connections(kind='inet'): | |
if conn.status == 'LISTEN' and 7000 <= conn.laddr.port < 8000: | |
ports.append(conn.laddr.port) | |
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): |
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 click | |
import logging | |
# Initialize logging | |
logging.basicConfig(level=logging.INFO) | |
def modify_rdl_for_sql2014(original_rdl): | |
lines = original_rdl.split('\n') | |
new_lines = [] | |
in_report_parameters_layout = False |
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 logging | |
from azure.identity import DefaultAzureCredential | |
from azure.mgmt.resource import SubscriptionClient | |
from azure.mgmt.consumption import ConsumptionManagementClient | |
from datetime import datetime, timedelta | |
# Initialize logging | |
logging.basicConfig(level=logging.DEBUG) | |
def fetch_all_subscription_ids(): |
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
{ | |
"aaron": [ | |
"erin", | |
"ron", | |
"ronnie" | |
], | |
"erin": [ | |
"aaron" | |
], | |
"ron": [ |
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
NODE_OPTIONS=--max-old-space-size=512 | |
jupyter lab build |
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
NVM_NODEJS_ORG_MIRROR=https://unofficial-builds.nodejs.org/download/release nvm install --lts |
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 requests | |
def getSkills(username): | |
res = requests.get("https://apps.runescape.com/runemetrics/profile/profile?activities=0&user={username}".format(username=username)) | |
skills =["attack","defence","strength","constitution","ranged","prayer","magic","cooking","woodcutting","fletching","fishing","firemaking","crafting","smithing","mining","herblore","agility","thieving","slayer","farming","runecrafting","hunter","construction","summoning","dungeoneering","runecrafting","invention","archaeology"] | |
return dict(zip(skills,list(sorted(res.json()['skillvalues'],key=lambda a: a['id'])))) | |
def getJagexInfoByUsername(username): | |
res = requests.get(f"https://secure.runescape.com/m=hiscore/index_lite.ws?player={username}") |