Skip to content

Instantly share code, notes, and snippets.

View Fortyseven's full-sized avatar
🥃
🟥🟧🟨⬜

Toby D Fortyseven

🥃
🟥🟧🟨⬜
View GitHub Profile
#!/usr/bin/env python
"""
This script will download the latest release of ollama from the github
releases page. You can use it for any project that has just one binary
file in the release. It will download the file, make it executable and
create a symlink to it with the name of the command you want to use.
This is intended to keep a reliable link to the latest version of the
binary, so you can use it in your path, scripts or other automation
without juggling with version numbers.
"""
Llama3 Prompt:
Given the following description of a special effect, create a Pygame app to implement it:
The rotozoom is a simple effect that goes through each pixel on the screen and maps the
coordinate of that pixel backwards through a sin/cos transform to determine which coordinate
of the source image to use. By applying a scale to that transform you also achieve the
zooming part of the rotozoom effect. Finally, the source coordinate is wrapped using modulo
to give a tiling effect.
# NOTE: This was generated using Llama3 on Meta.ai using this
# prompt. The first sentence is mine, and the rest is the gameplay
# description direct from Wikipedia...
"""
I'm going to describe some gameplay and I want you to create a
curses-based game in Python that implements it:
Every day, a five-letter word is chosen which players aim to
guess within six tries. After every guess, each letter is marked
import pygame
import math
import time
# Initialize Pygame
pygame.init()
# Set the screen dimensions
SCREEN_WIDTH = 320
SCREEN_HEIGHT = 240
#!/usr/bin/env python3
import sys
import json
import ollama
from rich import print
MODEL='llama3:latest'
PROMPT="""
You are a world class language translator. Translate the following text into English. Provide a simple pronunciation of the translated text for native English speakers, and any notes that might help give context for the translation. Respond ONLY with a properly JSON object (don't forget to escape any quotation marks) exactly like this: {\"src_language\":$LANGUAGE, \"translation\": $TRANSLATION, \"src_pronunciation\":$SRC_PRONUNCIATION,\"notes\":$NOTES}\n
The user will provide you with a description, and you are to generate an SVG file that draws what the user wants.
TIPS:
- Think through the visual layout of the design. Explain step by step how that might look. And with each step, imagine how those steps might be implemented using SVG commands.
- Think about exactly where in 2D space the items are in relation to each other.
- Take into account the drawing order of the objects. Do not allow objects meant to be in front appear earlier in the rendering.
- Consider the color of the objects you are drawing.
- The thickness and length of lines are important.
- Take color and composition of the entire scene into account.
// ==UserScript==
// @name 3D DOM viewer (Fortyseven hack)
// @namespace https://gist.github.com/Fortyseven/2c8486ad2e1ad07049120748bc87d2a5
// @version 2024-03-27
// @description 3D DOM viewer
// @author OrionReed (forked by hf02 (forked by Fortyseven)
// @match *://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant GM_registerMenuCommand
// ==/UserScript==
You are a forensic information analyst. The user will provide you a block of text from a news article, or other source.
You are to extract and summarize all the important pieces of information in the text.
You will then create a list all of the locations and organizations involved and who and where they are.
You will then create a list all of the people involved and who they are.
Create a timeline of events based on the dates and times provided in the text, where applicable.
This file has been truncated, but you can view the full file.
{
"gvlSpecificationVersion":3,
"tcfPolicyVersion":4,
"features":{
"1":{
"illustrations":[
],
"id":1,
"name":"Match and combine data from other data sources",
#! /usr/bin/env python
import argparse
# yes we could just slot in the country code but I wanted to
# do more with this, and I get the benefit of a dict with the
# valid entries in it
PLAYLISTS_BY_COUNTRY = {