Skip to content

Instantly share code, notes, and snippets.

View iqiancheng's full-sized avatar
🌴
On vacation

千橙 iqiancheng

🌴
On vacation
View GitHub Profile
// ==UserScript==
// @name 签到脚本lite
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 自动签到插件
// @author lyc8503
// @match *
// @connect *
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant GM_xmlhttpRequest
@ivershuo
ivershuo / main.go
Created March 10, 2023 17:57
一个chatbash
package main
import (
"context"
"fmt"
"os"
"os/exec"
"regexp"
"strings"
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active May 1, 2024 15:04
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
{
"⤡": "⤡",
"⊞": "⊞",
"×": "×",
"❮": "❮",
"❯": "❯",
"Loading...": "加载中...",
"Waiting...": "等待中...",
"In queue...": "队列中...",
"@@/^Waiting (.*)$/": "等待中 $1",
WebAutomation.LaunchFirefox.LaunchFirefox Url: $'''https://twitter.com/i/bookmarks''' WindowState: WebAutomation.BrowserWindowState.Maximized ClearCache: False ClearCookies: False WaitForPageToLoadTimeout: 60 Timeout: 60 BrowserInstance=> Browser
LOOP WHILE (0) = (0)
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Web Page \'https://twitter.com/i/bookmarks\'']['Share'] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Web Page \'https://twitter.com/i/bookmarks\'']['CopyLink'] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True WaitForPageToLoadTimeout: 60 MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0
Clipboard.GetText Text=> ClipboardText
Text.CropText.CropTextBeforeFlag Text: ClipboardText ToFlag: $'''?
import argparse
import logging
import math
import os
import random
from pathlib import Path
from typing import Optional
import numpy as np
import torch
@DenverCoder1
DenverCoder1 / README.md
Last active May 5, 2024 22:12
Convert MovieLens CSV export to Letterboxd import format

Script for converting watched movies and Wishlist CSVs from MovieLens to Letterboxd format.

Steps:

  1. Download movielens-ratings.csv and movielens-logs.csv from https://movielens.org/profile/settings/import-export by clicking "export ratings" and "export activity logs". For watchlist import, also download movielens-wishlist.csv by clicking "export wishlist".
  2. Change the RATINGS_CSV, LOGS_CSV, and WISHLIST_CSV to the paths of the movielens-ratings.csv, movielens-logs.csv, and movielens-wishlist.csv files respectively.
@y4code
y4code / tag_v2ex_username.js
Last active April 25, 2024 18:05
给 V2EX 用户打标签
// ==UserScript==
// @name 给 V2EX 用户打标签
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.v2ex.com/*
// @match http*://*.v2ex.com/*
// @match http*://v2ex.com/*s
// @match https://v2ex.com/
@xiaolai
xiaolai / download-all-my-kindle-books.ipynb
Last active August 16, 2023 01:17
a jupyter notebook for downloading all books to devices, using Selenium.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Narsil
Narsil / pure_torch.py
Created November 10, 2022 15:06
Loading a safetensors file with pure torch only
import mmap
import torch
import json
import os
from huggingface_hub import hf_hub_download
def load_file(filename, device):
with open(filename, mode="r", encoding="utf8") as file_obj:
with mmap.mmap(file_obj.fileno(), length=0, access=mmap.ACCESS_READ) as m: