Skip to content

Instantly share code, notes, and snippets.

View OhYee's full-sized avatar

OhYee OhYee

View GitHub Profile
@OhYee
OhYee / .bashrc
Last active March 23, 2025 12:34
echo '
# install the script
curl -o ${HOME}/.bashrc \
-k \
"http://proxy.ohyee.cc/gist.githubusercontent.com/OhYee/87228bbce831b4b7027e3d6407e7b2f8/raw/.bashrc" && \
source ~/.bashrc && \
init_bash
' >>/dev/null
@OhYee
OhYee / back
Created September 9, 2019 12:41
GPG backup and restore
#!/bin/bash
gpg --armor --export > pgp-public-keys.asc
gpg --armor --export-secret-keys > pgp-private-keys.asc
gpg --export-ownertrust > pgp-ownertrust.asc
OhYee%
@OhYee
OhYee / SpaceFn.ahk
Created December 16, 2018 13:14
SpaceFn
;SpaceFn
#inputlevel,2
$Space::
SetMouseDelay -1
Send {Blind}{F24 DownR}
KeyWait, Space
Send {Blind}{F24 up}
; MsgBox, %A_ThisHotkey%-%A_TimeSinceThisHotkey%
if(A_ThisHotkey="$Space" and A_TimeSinceThisHotkey<300)
Send {Blind}{Space DownR}
@OhYee
OhYee / gist.conf
Created November 22, 2018 15:53
reverse proxy to gist
# server, gist reverse proxy
server {
listen 80;
server_name gist.oyohyee.com;
access_log off;
resolver 8.8.8.8;
location / {
proxy_pass https://gist.github.com;
proxy_cache_valid 200 302 1h;
proxy_cache_valid 404 1m;
@OhYee
OhYee / vim.ahk
Last active May 10, 2024 17:57
实现类Vim操作
;SpaceFn
#inputlevel,2
SetCapsLockState, AlwaysOff ; 设置大写锁定为永远为关闭状态(本脚未触发时不会起作用)
*Capslock::SetCapsLockState, AlwaysOff ; 按下 Capslock 的时候设置为永远为关闭状态
^Capslock:: ; Ctrl + Capslock 切换大写锁定状态
If GetKeyState("CapsLock", "T") = 1
SetCapsLockState, AlwaysOff
Else
#include <math.h>
#include <stdio.h>
float c(float x, float y, float r, float p) {
return powf(powf(fabsf(x), p) + powf(fabsf(y), p), 1 / p) - r;
}
int f(float x, float y) {
float a = fmaxf(c(x, y, 15, 2), c(x, y + 25, 30, 2)), b = c(x, y - 7, 10, 4);
if (a < -1) // cap pattern
@OhYee
OhYee / 计算几何.cpp
Last active October 9, 2017 14:28
模板
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;
#define Log(format, ...) // printf(format, ##__VA_ARGS__)
/* 计算几何模板 */
const double eps = 1e-8;
const double INF = 0x4242424242424242;