Skip to content

Instantly share code, notes, and snippets.

View morisono's full-sized avatar

petro morisono

View GitHub Profile
@vgel
vgel / r1.py
Last active March 10, 2025 02:55
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(
@yamanahlawat
yamanahlawat / upgrade_shadcn_components.sh
Created January 19, 2025 17:59
Script to bulk update all shadcn/ui components in a Next.js project
#!/bin/bash
# update-shadcn-components.sh
# Script to bulk update all shadcn/ui components in a Next.js project
# Usage: ./update-shadcn-components.sh
# Set error handling
set -e
# Check if we're in a Next.js project
@Kinyugo
Kinyugo / install_cursor.sh
Last active March 3, 2025 16:21
Cursor AI IDE Installer and Updater Script
#!/bin/bash
installCursor() {
local CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
local ICON_URL="https://miro.medium.com/v2/resize:fit:700/1*YLg8VpqXaTyRHJoStnMuog.png"
local APPIMAGE_PATH="/opt/cursor.appimage"
local ICON_PATH="/opt/cursor.png"
local DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"
echo "Checking for existing Cursor installation..."
@yamanahlawat
yamanahlawat / upgrade_pyproject.py
Created December 5, 2024 12:58
Upgrade all packages using uv
"""
Script to update pyproject.toml dependencies based on uv.lock file.
Prerequisites:
1. Python 3.11+ (for tomllib)
2. tomli-w package (`pip install tomli-w`)
3. Updated uv.lock file (`uv lock --update` or `uv lock -U`)
Usage:
1. Update your lockfile: `uv lock -U`
@yhoiseth
yhoiseth / upgrade.py
Last active March 5, 2025 19:45
Upgrade all dependencies to their latest version using uv
#!/usr/bin/env python
# https://gist.github.com/yhoiseth/c80c1e44a7036307e424fce616eed25e
from typing import Any
from re import match, Match
import toml
import subprocess
def main() -> None:
with open("pyproject.toml", "r") as file:
@joeblackwaslike
joeblackwaslike / How-to-Python-in-Cursor.md
Last active March 10, 2025 12:57
How to use python with the Cursor IDE

How to use python with the Cursor AI IDE

We are going to edit cursors settings to point to the microsoft extensions marketplace.

  1. Remove all extensions and exit Cursor.
  2. Locate your Cursor project.json file depending on your platform and open it.
    • On MacOS: /Applications/Cursor.app/Contents/Resources/app/product.json
    • On Windows: C:\Users\<user_name>\AppData\Local\Programs\cursor\resources\app\product.json
    • On Linux: /usr/lib/code/product.json
  3. Locate the object value for key extensionsGallery in the json document.
@jamiephan
jamiephan / README.md
Last active March 9, 2025 04:06
A script to automatically add ALL items to your account in quixel

Script to add all items from quixel

As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874 items)

Note: This script only tested in the latest version of Chrome.

How to use

  1. Copy the script from below (run.js)
  2. Login into https://quixel.com
@swayducky
swayducky / cursor
Last active February 13, 2025 09:14
This fixes using "cursor" command in WSL
#!/usr/bin/env sh
# LATEST VERSION OF THIS SCRIPT: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4
# FORKED FROM: https://gist.github.com/ddwang/0046da801bcb29d241869d37ad719394
# 1) No longer has a hard-coded COMMIT
# 2) Auto-symlinks a "code" script to avoid wslCode.sh breaking
# HOW TO INSTALL:
# 1) Remove "c:\Users\<USER_NAME>\AppData\Local\Programs\cursor\resources\app\bin" from Windows Environment Settings
# 2) Modify this script with your Windows <USER_NAME> (NOT your WSL username) in the VSCODE_PATH variable
@forkyau
forkyau / hourly_rainfall_data-2024-06-14|14-30.csv
Created June 14, 2024 06:51
GIST created by python code
id station stationid value unit obstime date
0 流浮山 RF001 0 mm 2024-06-14T14:30:00+08:00 2024-06-14
1 湿地公园 RF002 0 mm 2024-06-14T14:30:00+08:00 2024-06-14
2 水边围 N12 0 mm 2024-06-14T14:30:00+08:00 2024-06-14
3 石岗 RF003 0 mm 2024-06-14T14:30:00+08:00 2024-06-14
4 大美督 RF004 3 mm 2024-06-14T14:30:00+08:00 2024-06-14
5 大埔墟 RF005 3 mm 2024-06-14T14:30:00+08:00 2024-06-14
6 北潭涌 RF006 0 mm 2024-06-14T14:30:00+08:00 2024-06-14
7 滘西洲 RF007 0 mm 2024-06-14T14:30:00+08:00 2024-06-14
8 西贡 N15 0 mm 2024-06-14T14:30:00+08:00 2024-06-14
@bartowski1182
bartowski1182 / calibration_datav3.txt
Last active March 8, 2025 01:39
Calibration data provided by Dampf, combines his own efforts on top of Kalomaze's. Used for calibrating GGUF imatrix files
In addition to a significant decrease in hepatic lipid accumulation in the IOE group, which inhibited energy intake by propionate enrichment, hepatic lipids were also significantly reduced in the mice in the IOP group, which was largely enriched with butyrate. Compared with the IOE group, IOP had a stronger regulatory effect on hepatic metabolism and triglyceride metabolism and higher levels of TCA cycle in the host. In addition, butyrate has the ability to promote browning of white adipose tissue (WAT) to brown adipose tissue (BAT).^[@ref39],[@ref40]^ WAT stores energy, whereas BAT uses energy for heating and consequently host energy expenditure increases.^[@ref41],[@ref42]^ However, adipose tissue weight does not change after WAT browning.^[@ref43]^ Therefore, the weight of adipose tissue of mice in the IOP group dominated by butyrate was greater than that of the mice in the IOE group dominated by propionate.
In conclusion ([Figure [7](#fig7){ref-type="fig"}](#fig7){ref-type="fig"}C), the improvement of ob