Skip to content

Instantly share code, notes, and snippets.

@t3dotgg
t3dotgg / model-prices.csv
Last active May 2, 2025 13:51
Rough list of popular AI models and the cost to use them (cost is per 1m tokens)
Name Input Output
Gemini 2.0 Flash-Lite $0.075 $0.30
Mistral 3.1 Small $0.10 $0.30
Gemini 2.0 Flash $0.10 $0.40
ChatGPT 4.1-nano $0.10 $0.40
DeepSeek v3 (old) $0.14 $0.28
ChatGPT 4o-mini $0.15 $0.60
DeepSeek v3 $0.27 $1.10
Grok 3-mini $0.30 $0.50
ChatGPT 4.1-mini $0.40 $1.60
@0test
0test / gist:9e3196c62341754675d1f1dfed7cd097
Created September 28, 2024 19:55
Как сделать так, чтобы подключение ВПН в Виндовс 10 работало только для определённых сайтов?
В Windows 10 можно настроить VPN так, чтобы он использовался только для определённых сайтов (или диапазонов IP-адресов), а остальной трафик шёл напрямую через основной интернет-канал. Это достигается с помощью настройки маршрутизации для VPN. Вот шаги, как это сделать:
1. Отключение общего шлюза для VPN
Первый шаг — это сделать так, чтобы VPN не использовался для всего трафика по умолчанию.
Открой "Параметры сети и интернета".
Перейди на вкладку VPN и выбери свой подключенный VPN.
Нажми Изменить параметры адаптера.
Найди адаптер VPN, щёлкни по нему правой кнопкой мыши и выбери Свойства.
В открывшемся окне выбери Протокол Интернета версии 4 (TCP/IPv4) и нажми Свойства.
@abrichr
abrichr / gpt4v.py
Last active May 2, 2025 13:48
Example usage of GPT4-V API
# from https://github.com/OpenAdaptAI/OpenAdapt/blob/44d4a55f332ef3b846933b38854372d4166fd2ea/experiments/gpt4v.py
"""Example usage of GPT4-V API.
Usage:
OPENAI_API_KEY=<your_api_key> python3 gpt4v.py \
[<path/to/image1.png>] [<path/to/image2.jpg>] [...] "text prompt"
Example:

Emscripten as a linker for Zig and C

This shows how to build a nontrivial program using Zig+Emscripten or C+Emscripten. In both cases Emscripten is only used as a linker, that is the frontend is either zig or clang.

"Nontrivial" here means the program uses interesting Emscripten features:

  • Asyncify
  • Full GLES3 support
  • GLFW3 support
@mpkuse
mpkuse / XYZ_2_latlong.py
Last active May 2, 2025 13:46
Convert GPS (Latitude and Longitude) to XYZ
""" Give a) points in localcoordinate system b) a gps lat long of the origin of the local coordinate system,
this script helps to convert XYZ to latlong.
Beware that the transformation will be off by an yaw angle. This is because the local cordinate frame is may/or may not align with the East-North-Up frame.
The way it works is XYZ --> ECEF --> geodedic (latlong)
main reference is still the wiki https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_ECEF_to_ENU.
However the procedure to convert from ECEF to geodedic in wikip does not give accurate results. Instead the algorithm
#EXTM3U
#EXTINF:-1,beINSports-fr1
http://iptv.am000.tv:8000/live/add17/add17/16.ts
#EXTINF:-1,beINSports-fr2
http://iptv.am000.tv:8000/live/add17/add17/17.ts
#EXTINF:-1,BEINSPORTS-FR3
http://iptv.am000.tv:8000/live/add17/add17/566.ts
#EXTINF:-1,Alkas-1
http://iptv.am000.tv:8000/live/add17/add17/73.ts
#EXTINF:-1,Alkas-2
@codeguy
codeguy / slugify.js
Created September 24, 2013 13:19
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active May 2, 2025 13:42
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@luismts
luismts / GitCommitBestPractices.md
Last active May 2, 2025 13:41
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@thaqebon
thaqebon / readme.md
Last active May 2, 2025 13:41
How to Use Tailwind v4 in Laravel 12 While Keeping Tailwind v3 for Filament v3 (Using Vite Separation)

🚀 How to Use Tailwind v4 in Laravel 12 While Keeping Tailwind v3 for Filament v3 (Using Vite Separation)

Problem: Laravel 12 supports Tailwind CSS v4, but Filament v3 is tied to Tailwind v3. Using both together can cause conflicts.

This guide shows how I solved the problem by isolating Filament’s frontend stack — with its own Tailwind v3, Vite config, and PostCSS config — separate from the Laravel app, which uses Tailwind v4.


🛠️ Step-by-Step Solution