Skip to content

Instantly share code, notes, and snippets.

View LessUp's full-sized avatar

Lessup LessUp

  • shenzhen
  • 12:09 (UTC +08:00)
View GitHub Profile
import cv2
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision import transforms, datasets
transform = transforms.Compose([
transforms.RandomRotation(10), # 随机旋转±10度
transforms.RandomAffine(0, translate=(0.1, 0.1)), # 随机平移10%
transforms.ToTensor(),
@LessUp
LessUp / glm-coding-plan-rush-helper.user.js
Last active June 17, 2026 03:57
⚡ GLM Coding Rush — 智谱编程助手一键抢购脚本 | Auto-Purchase Userscript for GLM Coding | 自动解锁售罄 · 高速重试 · 定时触发 · 支付保护 · 中英双语面板 | Auto-unlock sold-out · High-speed retry · Scheduled trigger · Payment guard · Bilingual panel | Tampermonkey/Violentmonkey | 点击 Raw 安装 · Click Raw to install
// ==UserScript==
// @name GLM Coding Rush - 智谱编程助手抢购脚本
// @namespace https://gist.github.com/LessUp
// @version 1.1.0
// @description 智谱 GLM Coding 一键抢购脚本 — 自动解锁售罄按钮 / 高速重试引擎 / bizId 双重校验 / 错误弹窗自动恢复 / 支付弹窗保护 / 秒级定时触发 / 可拖拽浮动面板
// @author LessUp
// @match *://www.bigmodel.cn/*
// @match https://bigmodel.cn/glm-coding*
// @run-at document-start
// @grant none
@LessUp
LessUp / strtok_p.cpp
Created June 16, 2022 07:15
[字符串分割]不改变原字符串 #strtok #split
#include <stdio.h>
#include <string.h>
#include <string>
using namespace std;
const char *strtok_p(const char *p, const char delim, const char **pos) {
// 分割结束
if (*p == '\0') {
return nullptr;
@LessUp
LessUp / split.cpp
Created June 14, 2022 03:12
[分割字符串] #split #c++
#include <string>
#include <vector>
#include <iostream>
using namespace std;
void split(const string &s, vector<string> &tokens, const string &delimiters = " ") {
string::size_type lastPos = s.find_first_not_of(delimiters, 0);
string::size_type pos = s.find_first_of(delimiters, lastPos);
while (string::npos != pos || string::npos != lastPos) {
@LessUp
LessUp / print-cur-path.cpp
Created June 14, 2022 03:09
[打印当前目录] C++
#include <iostream>
#include <filesystem>
using namespace std;
namespace fs = std::filesystem;
int main() {
std::cout << "Current working directory: " << fs::current_path() << '\n';
return 0;
}
@LessUp
LessUp / MyQueue.hpp
Created June 14, 2022 01:57
[多线程] 通过队列创建生产者消费者线程 #thread #c++
#include <queue>
#include <mutex>
#include <condition_variable>
using namespace std;
class MyQueue {
private:
mutex mut;
condition_variable cond;