Skip to content

Instantly share code, notes, and snippets.

View ghlin's full-sized avatar
😵

ghlin ghlin

😵
View GitHub Profile
@ghlin
ghlin / userChrome.css
Last active August 29, 2021 07:00
Proton UI tweaks
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#toolbar-menubar {
display: none !important;
}
/* {{{ remove left-most drag space */
/*
.titlebar-spacer[type="pre-tabs"], .titlebar-placeholder[type="pre-tabs"] {
display: none !important;
@ghlin
ghlin / keeper.c
Created January 13, 2019 10:02
保持大上Paperlike显示器始终唤醒
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/input.h>
#include <linux/uinput.h>
void emit(int fd, int type, int code, int val)
{
@ghlin
ghlin / llvm-pkg.sh
Created November 7, 2018 04:12
a shell script to install/update llvm+clang toolchain (build from source)
#!/bin/bash
# tuna mirror, see https://mirrors.tuna.tsinghua.edu.cn/help/llvm/
# LLVM_REPO_ROOT=https://git.llvm.org/git
LLVM_REPO_ROOT=https://mirrors.tuna.tsinghua.edu.cn/git/llvm
LLVM_TREE_DIR=$HOME/.local/lib/llvm-tree
LLVM_BUILD_DIR=$HOME/.local/lib/llvm-build
LLVM_INSTALL_DIR=$HOME/.local/lib/llvm
@ghlin
ghlin / sited-decode.ts
Created August 29, 2018 10:12
SITED插件解码
import { readFileSync, writeFileSync } from "fs";
function decodeSiteD(fileContent: Buffer) {
const [ _, content, timestamp ] = fileContent.toString().split('::');
const sample = content
.split('')
.filter((_, idx) => idx % 2 == 0)
.join('');
@ghlin
ghlin / gulpfile.js
Created June 6, 2017 13:46 — forked from floatdrop/gulpfile.js
gulp.watch - run mocha tests on every file changed
// npm i gulp gulp-watch gulp-mocha gulp-batch
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var batch = require('gulp-batch');
gulp.watch(['test/**', 'lib/**'], batch(function (events, cb) {
return gulp.src(['test/*.js'])
.pipe(mocha({ reporter: 'list' }))
.on('error', function (err) {