Skip to content

Instantly share code, notes, and snippets.

- DOMAIN-SUFFIX, google.com, Proxy
- DOMAIN-SUFFIX, sentry.io, DIRECT
@glacjay
glacjay / soft-layers.ahk
Last active January 5, 2022 02:20
simulate multi-layer keyboard
#inputlevel,2
; Esc | LCtrl
$LCtrl::
SetMouseDelay -1
Send {Blind}{LCtrl DownR}
KeyWait, LCtrl
Send {Blind}{LCtrl up}
; MsgBox, %A_ThisHotkey%-%A_TimeSinceThisHotkey%
if (A_ThisHotkey="$LCtrl" and A_TimeSinceThisHotkey < 250)
// ==UserScript==
// @name youtube playlist cleaner
// @namespace http://tampermonkey.net/
// @version 0.2
// @description add a filter button to filter out watched videos
// @author GlacJAY <[email protected]>
// @match https://www.youtube.com/playlist?list=*
// @grant none
// ==/UserScript==
@glacjay
glacjay / wubi86_single.py
Created January 27, 2021 08:50
制作 rime 五笔86 单字词库
# forked from https://github.com/yekingyan/rime-wubi-86-single/blob/master/wubi86_single.py
import re
INPUT_FILE_PATH = "wubi86.dict.yaml"
OUTPUT_FILE_PATH = "wubi86.dict.yaml.single"
@glacjay
glacjay / IframeDemo.vue
Last active January 7, 2018 09:20
vue 集成 iframe
<template>
<iframe :src="the_url" @load="onIframeLoad" />
</template>
<script>
export default {
data () {
return {
the_url: "http://xxx.com/yyy",
some_id: 42
@glacjay
glacjay / sudoku.go
Created July 9, 2011 10:35
Solve Sudoku problems in Go.
package main
import (
"io/ioutil"
"log"
"os"
"regexp"
"strings"
)
@glacjay
glacjay / gist:856270
Created March 5, 2011 09:59
A simple tool to find out a particular machine's IP address within a LAN.
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <pthread.h>
#include <unistd.h>
#include <arpa/inet.h>
@glacjay
glacjay / gist:856140
Created March 5, 2011 05:13
Show a problem about CR/LF under Linux.
# Save this file using DOS's CR/LF.
export VAR1=blahblahblah
export VAR2=hello
export VAR1=$VAR1:$VAR2
@glacjay
glacjay / tun-ping-win.py
Created September 19, 2010 16:24
Reading/Writing OpenVPN's TUN/TAP Device under Windows using Python.
import _winreg as reg
import win32file
adapter_key = r'SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}'
def get_device_guid():
with reg.OpenKey(reg.HKEY_LOCAL_MACHINE, adapter_key) as adapters:
try:
@glacjay
glacjay / tun-ping-mac.go
Created September 19, 2010 16:03
Reading/Writing Mac's TUN/TAP device using Go.
package main
import (
"exec"
"log"
"os"
)
func main() {
file, err := os.Open("/dev/tun0", os.O_RDWR, 0)