Skip to content

Instantly share code, notes, and snippets.

@elyase
elyase / r1.py
Created January 26, 2025 12:25 — forked from vgel/r1.py
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(
import asyncio
import base64
import json
import os
import pyaudio
from websockets.asyncio.client import connect
class SimpleGeminiVoice:
def __init__(self):
@elyase
elyase / .cursorrules.md
Created November 7, 2024 12:12 — forked from bossjones/.cursorrules.md
cursor rules generated with the help of sonnet 3.5

Python Development Assistant Prompt System

Version Control

version: 1.0.0
last_updated: 2024-03-19
sections:
  - core_requirements
  - python_version
 - code_style
@elyase
elyase / Cargo.toml
Created May 14, 2024 11:19 — forked from kallydev/Cargo.toml
Alloy log subscriber.
[package]
name = "playground"
version = "0.1.0"
edition = "2021"
[dependencies]
alloy = { git = "https://github.com/alloy-rs/alloy.git", features = ["contract", "provider-ws", "rpc-types-eth"] }
anyhow = "1.0.82"
tokio = { version = "1.37.0", features = ["full"] }
tracing = "0.1.40"
@elyase
elyase / simulate_swap.py
Last active May 5, 2024 11:59
Swap simulation with pyrevm
from eth_abi import decode, encode
from eth_utils import function_signature_to_4byte_selector
from pyrevm import EVM
# https://etherscan.io/tx/0x652bae3b1c11fbcf64309c2dfec5537b9bd1d3f2b521176f71ba1115a313ecbd"
# Swap 0.031485012992133186 ETH for 1,110.686711078457978839 CSWAP on Uniswap v2
block_number = 19726294
caller = "0xc0170e050355408e53800d093f3f13c3a53b29c8"
router = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
token = "0xae41b275aaAF484b541A5881a2dDED9515184CCA"
@elyase
elyase / abi.py
Created January 18, 2024 11:26 — forked from reinforcementwonder/abi.py
uniswap v2 buy & sell
import json
MIN_ERC20_ABI = json.loads(
"""
[{"constant": true, "inputs": [], "name": "name", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" } ], "name": "approve", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_from", "type": "address" }, { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "decimals", "outputs": [ { "name"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@elyase
elyase / run in warp.popcliptxt
Last active September 8, 2024 09:51
Run command in Warp with pop clip
-- # PopClip Run in Warp
-- { name: Run in Warp, icon: iconify:simple-icons:warp, language: applescript }
tell application "Warp"
activate
tell application "System Events"
tell process "Warp"
delay 0.01
set sourceText to "{popclip text}"
keystroke sourceText
delay 0.01
@elyase
elyase / ibsimu_install.md
Created November 26, 2021 17:45
ibsimu install ubuntu

Tested on ubuntu 20.04.3

Install dependencies

sudo apt-get install build-essential
sudo apt install libcairo2-dev
sudo apt install libgsl-dev
sudo apt install libgtk-3-dev

Download the code

@elyase
elyase / install_debian.md
Last active November 26, 2021 17:52
ibsimu installation debian/ubuntu

Tested on debian buster

Install dependencies

sudo apt install libcairo2-dev
sudo apt install libgsl-dev
sudo apt install libgtk-3-dev

Download the code