Skip to content

Instantly share code, notes, and snippets.

import requests
import os
import json
from recipe import Recipe
prompt_text = "List a few popular cookie recipes, and include the amounts of ingredients."
generation_config = {
"responseMimeType": "application/json",
"responseSchema": {
"type": "ARRAY",
from turtle import Turtle
alku_x = 0
alku_y = 0
t = Turtle()
# Piirrä kolmio
t.penup()
t.goto(alku_x, alku_y)
@mjpanula
mjpanula / poptest.py
Last active September 30, 2025 07:55
remove vs. pop in python
import time
import random
# ohjelma esittää 2 algoritmia hirvien poistoon listasta
# remove-metodia käyttävä ratkaisu on lähes 10 kertaa hitaampi
# kuin pop-metodilla toteutettu ratkaisu
def luo_lista(): # tässä luodaan lista jossa 10 % elukoista on hirviä
lista = []
i = 0
# Minimal Script to Schedule Temporary GPO Link Outage
# --- Hardcoded Configuration ---
$GPOName = "Firewall - Room 101 - Scheduled Outage" # <-- EDIT: Your GPO Name
$OUPath = "OU=Room 101,OU=Computers,DC=yourdomain,DC=com" # <-- EDIT: Your Room OU Distinguished Name
# -------------------------------
# --- Parameters (Input Arguments) ---
param(
[Parameter(Mandatory=$true)]
import ollama
import chromadb
documents = [
"Llamas are members of the camelid family meaning they're pretty closely related to vicuñas and camels",
"Llamas were first domesticated and used as pack animals 4,000 to 5,000 years ago in the Peruvian highlands",
"Llamas can grow as much as 6 feet tall though the average llama between 5 feet 6 inches and 5 feet 9 inches tall",
"Llamas weigh between 280 and 450 pounds and can carry 25 to 30 percent of their body weight",
"Llamas are vegetarians and have very efficient digestive systems",
"Llamas live to be about 20 years old, though some only live for 15 years and others live to be 30 years old",
import ollama
import chromadb
documents = [
"Llamas are members of the camelid family meaning they're pretty closely related to vicuñas and camels",
"Llamas were first domesticated and used as pack animals 4,000 to 5,000 years ago in the Peruvian highlands",
"Llamas can grow as much as 6 feet tall though the average llama between 5 feet 6 inches and 5 feet 9 inches tall",
"Llamas weigh between 280 and 450 pounds and can carry 25 to 30 percent of their body weight",
"Llamas are vegetarians and have very efficient digestive systems",
"Llamas live to be about 20 years old, though some only live for 15 years and others live to be 30 years old",
from ollama import chat
from ollama import ChatResponse
import time
def kysy(kysymys, role='user'):
start_time = time.time()
response = chat(model='gemma3:4b', messages=[
{
'role': role,
'content': kysymys,
import requests
from bs4 import BeautifulSoup
def fetch_yle_news():
url = "https://yle.fi/"
response = requests.get(url)
data = response.text
return data
news_data = fetch_yle_news()
{
"models": [
{
"title": "Llama3.1 8B",
"provider": "ollama",
"model": "llama3.1:8b"
}
],
"tabAutocompleteModel": {
"title": "Qwen2.5-Coder 1.5B",