Skip to content

Instantly share code, notes, and snippets.

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

Foair

🦩
Proceeding...
View GitHub Profile
@Foair
Foair / init.m
Created November 28, 2018 12:03
Mathematica 初始化文件
(** User Mathematica initialization file **)
System`clear := Clear["Global`*"]
System`clc :=
Module[{obj}, obj = EvaluationCell[];
SelectionMove[obj, All, Notebook]; NotebookDelete[]; "clc"]
SetOptions[$FrontEndSession, Magnification -> 1.5]
SetAttributes[Derivative, Protected]
function copyToClipboard( text ){
var copyDiv = document.createElement('div');
copyDiv.contentEditable = true;
document.body.appendChild(copyDiv);
copyDiv.innerHTML = text;
copyDiv.unselectable = "off";
copyDiv.focus();
document.execCommand('SelectAll');
document.execCommand("Copy", false, null);
document.body.removeChild(copyDiv);
import gulp from 'gulp';
import browserSync from 'browser-sync';
import sass from 'gulp-sass';
import pug from 'gulp-pug';
// import gulpLoadPlugins from 'gulp-load-plugins';
// import del from 'del';
// const $ = gulpLoadPlugins();
const server = browserSync.create();
@Foair
Foair / encode.py
Created May 19, 2018 05:09
Python Base64 编码
import base64
import os
string = input('> ')
encodestr = base64.b64encode(string.encode('utf-8'))
print(str(encodestr, 'utf-8'))
常规
勾选【显示行号】
勾选【在剪贴板保留换行符】(就算文档是 LF 换行符,复制到记事本中也可以正常换行)
文件
勾选【优先选择 UTF-8】(打开 GBK 的英文文档时,会提升到 UTF-8 编码)
被其他程序更改时 - 自动重新载入
勾选【换行符不一致时进行提示】
新建文件...
@Foair
Foair / HOSTS.conf
Last active September 11, 2025 09:57
# LOCAL DEV
127.0.0.1 notes
127.0.0.1 io
127.0.0.1 app
# BLOCK OR ALLOW SOFTWARE
## XMind
0.0.0.0 www.xmind.net
## Bandicam
@Foair
Foair / show_me_how_to_write.html
Last active February 25, 2019 02:40
一个用于展示大屏汉字的网页
<!DOCTYPE html>
<html lang="cmn-Hans">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=Edge">
<title>学汉字</title>
<style>
body {
@Foair
Foair / a_hrefs.js
Created February 14, 2018 10:52
从网页导出播放列表的链接
str = ''
for (a of $0.getElementsByTagName('a')) {
str += 'you-get ' + a.href + '\n'
}
console.log(str)
@Foair
Foair / aria2c.py
Created January 31, 2018 11:07 — forked from lpimem/aria2c.py
Aria2 Python Client
import json
import requests
class Aria2c:
'''
Example :
client = Aria2c('localhost', '6800')
# print server version
@Foair
Foair / aria2.conf
Last active January 16, 2018 11:00
# aria2 配置 #
# aria2:https://aria2.github.io/
# 官方文档:https://aria2.github.io/manual/en/html/index.html
# aria2c 文档:https://aria2.github.io/manual/en/html/aria2c.html
# 选项和默认值可查询文档
# 书写方式 #
# ? 删掉第 1 行前面的「#」 ? 删掉第 2 行前面的「#」 ? ...
# ##<bt-enable-lpd> 找到 bt-enable-lpd 并将其注释
# #bt-tracker=<URI>,... 替换 <URI> 为其他内容