Skip to content

Instantly share code, notes, and snippets.

View dai's full-sized avatar
:octocat:
still Catch it Up.

dai dai

:octocat:
still Catch it Up.
View GitHub Profile
declaration:youtube:get_metadata{description:Retrieves metadata of YouTube videos.,parameters:{properties:{urls:{description:Urls of videos for which metadata should be retrieved for.,items:{type:STRING},nullable:true,type:ARRAY}},propertyOrdering:[urls],type:OBJECT},response:{anyOf:[{description:Metadata of a video.,properties:{channel_id:{nullable:true,type:STRING},channel_name:{nullable:true,type:STRING},like_count:{format:int64,nullable:true,type:INTEGER},publish_date:{description:Date of when the video was published in YYYY-MM-DD format.,nullable:true,type:STRING},title:{nullable:true,type:STRING},url:{nullable:true,type:STRING},video_length:{description:The length of the video in ISO 8601 format.,nullable:true,type:STRING},view_count:{format:int64,nullable:true,type:INTEGER}},propertyOrdering:[channel_id,channel_name,like_count,publish_date,title,url,video_length,view_count],title:#/components/schemas/VideoMetadata,type:OBJECT}],type:ARRAY}}
declaration:youtube:play{description:Play video or playlist o
@shotadft
shotadft / bin2bmp.py
Created September 26, 2025 15:36
バイナリをBMP形式の画像に変換するだけの関数。https://x.com/McDonaldsJapan/status/1971530192137990518 解読の為に作った
from PIL import Image
import numpy as np
def binary_to_image(bin: str, width: int, height: int):
data = np.array([int(b) * 0xFF for b in bin], dtype=np.uint8)
out = np.pad(data, (0, (width * height) - len(data)), 'constant')
img = Image.fromarray(out.reshape((height, width)))
return img
@intellectronica
intellectronica / pydantic-xml-structured-inputs.ipynb
Created July 16, 2025 08:47
pydantic-xml-structured-inputs.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dgl
dgl / check-decdhl.sh
Last active November 16, 2025 15:44
Check for DECDHL support (DEC double-height lines)
#!/usr/bin/env bash
# © David Leadbeater, 2025 <http://©.st/dgl>
# SPDX-License-Identifier: 0BSD
#
# Detect whether terminals support DECDHL (DEC double-height lines). This is
# not perfect, as terminals are a mess, to put it mildly.
#
# If you want see the output in your terminal, try: curl -i ip.wtf
#
# Usage:
@torvalds
torvalds / gist:6faadce34c56d53b2d5352da0c3cd093
Last active November 24, 2025 16:18
Not involved with any fishy crypto fishy business
I'm told that there are people claiming to "tokenize" my git repositories with my approval.
I just want to clarify that that is not the case. I do not believe in monetizing my repositories.
If you believe crypto-currencies are anything but a scam, I have a bridge to sell you.
But I'm not selling source code.
@martinsaposnic
martinsaposnic / spiral-grant-proposal-martin-saposnic.txt
Created April 15, 2025 18:35
Grant proposal - Spiral - Martin Saposnic
Hi Spiral Team,
I hope you’re well. I’m Martin Saposnic, a professional developer
with over 11 years of experience based in Buenos Aires, Argentina.
Growing up in a country where economic instability and stringent
financial policies are a way of life, I learned early on that
traditional financial systems have inherent limits. This background
shaped my understanding of Bitcoin’s potential, not merely as an
alternative, but as a vital tool for promoting financial autonomy on
a global scale. I’ve been fascinated with Bitcoin for over 8 years,

A Journey Though Elixir's Syntax

This was written in response to this Reddit post. Which asked:

defmodule User do
  @enforce_keys [:name]
  defstruct [:name, age: 0, email: nil]
end
@awestley
awestley / speed.py
Last active April 8, 2025 17:06
speed.py
import ollama
import time
import re
from transformers import AutoTokenizer
MODEL = "r1-1776-500:671b"
QUESTIONS = [
"Explain how a rocket engine works in simple terms.",
"Can you tell me how fuel combustion happens inside the engine?",
@attilatorda
attilatorda / Add_Explorer_Context_Menus.bat
Last active September 23, 2025 13:19
Windows Explorer Right-Click Tools
@echo off
SETLOCAL EnableDelayedExpansion
:: Check if running as admin (required for registry edits)
net session >nul 2>&1
if %errorLevel% neq 0 (
echo This script requires administrator privileges.
echo Please right-click and "Run as administrator".
pause
exit /b
@neiser
neiser / conventional-commit-regex-for-gitlab.yml
Last active March 27, 2025 13:58
Conventional Commit Regex for GitLab Push Rule
# The regex is split into a YAML sequence for better commenting
# Use
# yq 'join("")' conventional-commit-regex.yml
# to get the actual regex string!
# Test changes using
# https://regex101.com/r/tl6h3n/6 (please update this if you make some changes below)
# See also https://docs.gitlab.com/user/project/repository/push_rules/#validate-commit-messages
# In particular, note that GitLab uses multiline mode by default, so use \A, \z instead of ^ or $