This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $debugHelper = $debugHelper || {}; | |
$debugHelper = function () { | |
var href = "lib/debugger.css"; | |
var addCss = function () { | |
if (styleStyleIsLoaded(href) === true) { | |
return; | |
} | |
const head = document.head; | |
const link = document.createElement("link"); | |
link.type = "text/css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SETUP # | |
DOMAIN=example.com | |
PROJECT_REPO="git@github.com:example.com/app.git" | |
AMOUNT_KEEP_RELEASES=5 | |
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S) | |
RELEASES_DIRECTORY=~/$DOMAIN/releases | |
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME | |
# stop script on error signal (-e) and undefined variables (-u) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import triton | |
import triton.language as tl | |
def unpack_weights(packed: torch.Tensor, bits: int = 2) -> torch.Tensor: | |
values_per_item = 8 // bits | |
packed_shape = packed.shape | |
if len(packed_shape) == 1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# But - just read and edit the code however you like | |
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
gcm() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
print_usage() { | |
echo "usage: compress_video <input_file>" | |
echo "supported formats: mp4, webm, mkv, mov, avi, flv" | |
} | |
get_extension() { | |
f="${1##*/}" | |
case "$f" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import modal | |
vllm_image = modal.Image.debian_slim(python_version="3.10").pip_install( | |
[ | |
"vllm==0.5.3post1", # LLM serving | |
"huggingface_hub==0.24.1", # download models from the Hugging Face Hub | |
"hf-transfer==0.1.8", # download models faster | |
] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3 | |
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592 | |
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code. | |
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices. | |
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning. | |
- Follow the user’s requirements carefully & to the letter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from collections import deque | |
from typing import Dict, List | |
import time | |
import openai | |
# Configuration | |
OBJECTIVE = "Solve world hunger" | |
YOUR_API_KEY = "your-openai-api-key-here" | |
INITIAL_TASK = "Develop a comprehensive plan to solve world hunger" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Keyboard Shortcut Scripts | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Run scripts with keyboard shortcuts | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
from manim import * | |
import networkx as nx | |
import random | |
import numpy as np | |
import itertools | |
class UF: | |
def __init__(self, ids): |
NewerOlder