Skip to content

Instantly share code, notes, and snippets.

View kuanyui's full-sized avatar
❄️
なんでそんなに慣れてんだよ!

クエン酸 kuanyui

❄️
なんでそんなに慣れてんだよ!
View GitHub Profile
// ==UserScript==
// @name Full-Width in MDN
// @version 0.3
// @grant none
// @match https://developer.mozilla.org/*
// @run-at document-end
// @grant none
// ==/UserScript==
const el = document.createElement('style')
// ==UserScript==
// @name Full-Width in Webpack
// @version 0.1
// @grant none
// @match https://webpack.js.org/*
// @run-at document-end
// @grant none
// ==/UserScript==
const el = document.createElement('style')
// ==UserScript==
// @name Full-Width CSS-Trick
// @version 0.1
// @grant none
// @match https://css-tricks.com/*
// @run-at document-end
// @grant none
// ==/UserScript==
const el = document.createElement('style')
// ==UserScript==
// @name Full-Width Stackoverflow
// @description try to take over the world!
// @author You
// @version 0.1
// @grant none
// @match https://stackoverflow.com/questions/*
// @run-at document-end
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Always English in Mozilla Doc
// @version 1
// @grant none
// @match https://developer.mozilla.org/*
// @run-at document-start
// ==/UserScript==
const matched = location.pathname.match(/[/](.*)[/]docs[/]/)
if (matched &&
// ==UserScript==
// @name Pixi API Reference Document Title
// @version 1
// @grant none
// @match http://pixijs.download/release/docs/*
// @match https://pixijs.download/release/docs/*
// @run-at document-end
// ==/UserScript==
//"http://pixijs.download/release/docs/PIXI.BaseTexture.html#.from"
@kuanyui
kuanyui / extend_prototype.ts
Last active December 1, 2020 08:04
Some small type-awared utils for TypeScript.
export { }
declare global {
interface Array<T> {
/** Return the last element of this array. */
last (): T | undefined
/** Delete the first element from this array. If delete success, return true. */
delete (elem: T): boolean
/** Delete the first element satisfying the @param fn. If delete success, return true. */
deleteIf (fn: (elem: T) => boolean): boolean
@kuanyui
kuanyui / .xprofile
Last active September 7, 2023 12:39
Ubuntu + Auto Login + Openbox + Screen Resolution +Autostart GUI application
# ~/.xprofile
# Screen Resolution
xrandr -s 1280x720
# Disable Screensavers and Energy Management
# Use `xset q` to see if it succeded. See ~/.xsession-errors to check errors when startup.
# ... Donno why Ubuntu work but Lubuntu doesn't...
xset dpms 0 0 0 && xset s noblank && xset s off
export const JsonFileIo = {
/**
* NOTE: This function works smoothly on Firefox, but crash on Chromium.
* I don't know why, but DON'T USE
*/
read(): Promise<any> {
return new Promise((resolve, reject) => {
const inputEl = document.createElement("input")
inputEl.type = 'file'
var path = require('path')
var child_process = require('child_process')
const rootDir = path.join(__dirname, '../.')
child_process.exec(
`grep -RIPzo --no-filename --include=\\*.proto "(?s)\\n rpc (Get|Set|Run).*?(get|post|put|delete):\\N+" "${rootDir}"`,
{ maxBuffer: 1024 * 500 * 1024 },
function (error, stdout, stderr) {