Skip to content

Instantly share code, notes, and snippets.

View softyoda's full-sized avatar

amcgi softyoda

View GitHub Profile
@softyoda
softyoda / gist:a7f2ea15084f0401a2db43f2fc990b18
Created February 28, 2025 16:34
Prompt : how many days there are between February 19, 2020, and February 28, 2025
So I need to find out how many days there are between February 19, 2020, and February 28, 2025. Hmm, that seems straightforward, but I should be careful with the leap years since they affect the number of days in February.
First, I need to figure out how many years are between 2020 and 2025. That would be 2021, 2022, 2023, and 2024. Wait, actually, from 2020 to 2025 is 5 years, but since we're starting in February and ending in February, I need to see if we include the leap years properly.
Let me recall that a leap year is every 4 years, and 2020 was a leap year because it's divisible by 4. So, 2024 would also be a leap year, right? Yes, because 2024 divided by 4 is 606, with no remainder.
So, between 2020 and 2025, the leap years are 2020 and 2024. But wait, 2020 is included, and 2024 is before 2025, so yes, both are within the range.
Now, since we're starting on February 19, 2020, and 2020 is a leap year, that means February 2020 has 29 days. So, from February 19 to February 29, 2020, that's 10 days, I
@softyoda
softyoda / prompt.llm
Created February 25, 2025 16:34
Human in house in sphere in cube in cylinder in pyramid
Make a bpy blender python script that will draw :
maxima
* a human that is inside a house
* the house is inscribed in a sphere
* the sphere is inscribed in a cube
* the cube is inscribed in a cylinder
* the cylinder is inscribed in a pyramid
Before starting, think deeply about how you could draw those different elements using primitive shapes and how to follow each instruction to be truth.
@softyoda
softyoda / convert_glb.py
Created July 19, 2024 15:09
Replace ktx2 texture with png ones to import in blender without KHR_texture_basisu
import os
import subprocess
import json
import multiprocessing
from tqdm import tqdm
import time
import tempfile
import shutil
import logging
import glob
@softyoda
softyoda / scrap_srt_and_description.py
Created February 5, 2024 20:09
Scrap STR, Description, Title of all video of a youtube channel.
import requests
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.formatters import SRTFormatter
import json
from datetime import timedelta
def download_channel_videos(api_key, channel_id):
base_url = "https://www.googleapis.com/youtube/v3"
videos_url = f"{base_url}/search?key={api_key}&channelId={channel_id}&part=snippet,id&order=date&maxResults=50"
video_details_list = []
@softyoda
softyoda / all.json
Created February 5, 2024 19:59
Toutes les vidéos du LeMuseumdesPourquois (https://www.youtube.com/@LeMuseumdesPourquois) 05/02/2024 Titre, description, transcription, durée, vues.
This file has been truncated, but you can view the full file.
[
{
"video_id": "w5V9a_xTqcI",
"video_full_url": "https://www.youtube.com/watch?v=w5V9a_xTqcI",
"video_title": "🗣️ Pourquoi avez-vous un mauvais accent ? (Mini Pourquoi)",
@softyoda
softyoda / remove_pdf_password.py
Created February 1, 2024 15:52
Remove password from PDF, little python snippet
from PyPDF2 import PdfReader, PdfWriter
# Path to the password-protected PDF file
input_pdf_path = 'path/to/protected/file.pdf'
# Password for the PDF file
password = 'yourPassword'
# Path for the new PDF file without a password
output_pdf_path = 'path/to/new/file.pdf'
reader = PdfReader(input_pdf_path)
@softyoda
softyoda / index.md
Last active October 3, 2023 13:15 — forked from JayFoxRox/index.md
3D Gaussian Splatting links
@softyoda
softyoda / blender_mirror_performance.py
Created July 7, 2022 11:06
blender_mirror_performance
import bpy
bpy.ops.mesh.primitive_monkey_add(size=2, enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
bpy.ops.object.modifier_add(type='SUBSURF')
bpy.context.object.modifiers["Subdivision"].levels = 3
bpy.ops.object.modifier_apply(modifier="Subdivision")
bpy.ops.object.modifier_add(type='ARRAY')
bpy.context.object.modifiers["Array"].count = 50
bpy.ops.object.modifier_apply(modifier="Array")
// ==UserScript==
// @name placestart
// @namespace http://tampermonkey.net/
// @version 0.1
// @description credit to oralekin
// @author oralekin
// @match https://hot-potato.reddit.com/embed*
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant none
// ==/UserScript==