Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 281ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login

All gists

All Recently liked Recently forked
Recently created Least recently created Recently updated Least recently updated
myceliatrix

myceliatrix / scrape-recipe.txt

Last active 1 month ago
0 0 2
1 Extract recipe data from the provided webpage content and return a single JSON object conforming to the schema.org `Recipe` format.
2
3 Schema reference: https://schema.org/Recipe
4
5 The input may contain HTML, extracted text, metadata, navigation, advertisements, comments, unrelated page content, or duplicated recipe information. Identify and extract only the actual recipe.
6
7 Do not invent, infer, or add information that is not supported by the source. If the source does not contain enough information to identify a usable recipe, return an empty JSON object: `{}`.
8
9 ## Extraction rules
myceliatrix

myceliatrix / Is even

Last active 2 months ago shitposts python c generator

A generator that spits out a massive amount of C for a useless task

0 0 1
1 import sys
2
3 def generate_subfunction(file, start, end):
4 file.write(f"int is_even_{start}_{end}(int num) {{\n")
5 conditions = ""
6 for i in range(start, end + 1):
7 even_check = "1" if i % 2 == 0 else "0"
8 conditions += f"(num == {i}) ? {even_check} : "
9 conditions += "0"
10 file.write(f" return {conditions};\n")