Skip to content

Instantly share code, notes, and snippets.

View Foair's full-sized avatar
🦩
Proceeding...

Foair

🦩
Proceeding...
View GitHub Profile
@Foair
Foair / .wslconfig
Last active June 20, 2022 03:28
WSL
[wsl2]
memory=16GB
swap=0

PowerShell:

git init; ni -ItemType SymbolicLink -Target "prepare-commit-msg" .git\hooks\prepare-commit-msg

Bash:

curl -Lo .git/hooks/prepare-commit-msg https://gist.github.com/
@Foair
Foair / colors.js
Created April 5, 2020 12:41
https://flatuicolors.com/ 提取颜色代码
var rgbToHex = function(rgb) {
var hex = Number(rgb).toString(16);
if (hex.length < 2) {
hex = "0" + hex;
}
return hex;
};
var fullColorHex = function(r, g, b) {
var red = rgbToHex(r);
@Foair
Foair / helper.py
Created April 5, 2020 11:16
在文本中书写长字符串
s = """
s | asd +
adf sdaf+
dfasdfasdf_
"""
s = """
select *_
from app+
le+
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
def main():
symbol = os.environ.get('ARG_SYMBOL')
if not symbol:
symbol = 'Δ'
@Foair
Foair / deploy.bat
Created May 23, 2019 06:24
将 Vue 项目生成并提交至 GitLab
chcp 65001
cd /d "C:\Users\Foair\Coding\Project\twinkle"
REM 必须使用 cmd 命令,不然在 yarn.cmd 会退出
cmd /c "C:\Program Files (x86)\Yarn\bin\yarn.cmd" build
cd dist
git init
git add .
git commit -m update
git remote add origin [email protected]:logsapling/school_index_back.git
git push -f origin HEAD:back
@Foair
Foair / bilibili.py
Created December 27, 2018 08:50
bilibili 每日签到
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import asyncio
import base64
import hashlib
import json
import random
import sys
import time
@Foair
Foair / extensions.txt
Last active December 18, 2018 10:36
Visual Studio Code 配置
VS Code 扩展列表
Anaconda Extension Pack - Visual Studio Marketplace
https://marketplace.visualstudio.com/items?itemName=ms-python.anaconda-extension-pack
Bracket Pair Colorizer 2 - Visual Studio Marketplace
https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer-2
C/C++ - Visual Studio Marketplace
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
@Foair
Foair / index.js
Created December 8, 2018 14:23
Node 控制台进度条
const ProgressBar = require('./progress-bar');
const pb = new ProgressBar('下载进度', 50);
let num = 0,
total = 200;
function download() {
if (num <= total) {
pb.render({ completed: num, total });
++num;
@Foair
Foair / vcb-a.js
Created December 8, 2018 09:53
VCB-Studio 开放课程文档递归获得下载地址
const axios = require('axios');
const fs = require('fs');
axios.defaults.baseURL = 'https://vcb-s.nmm-hd.org';
const visitedLinks = [];
const files = [];
async function getURL(url) {
if (visitedLinks.includes(url)) return;