Skip to content

Instantly share code, notes, and snippets.

View KevCui's full-sized avatar
🖤

K̶e̶v̶i̶n̶ KevCui

🖤
View GitHub Profile
@KevCui
KevCui / punycode-url-highlight.user.js
Last active April 16, 2017 14:24
Punycode url highlight
// ==UserScript==
// @name punycode url highlight
// @include *
// @grant none
// ==/UserScript==
(function() {
'use strict';
var url= window.location.href;
if (url.indexOf("xn--") != -1) {
@KevCui
KevCui / auto-copy.user.js
Last active January 30, 2021 04:25
Auto copy selected text
// ==UserScript==
// @name auto-copy
// @include *
// @grant GM_setClipboard
// ==/UserScript==
function getSelectedText() {
// console.log(getSelection().anchorNode.nodeName);
if (window.getSelection().anchorNode.nodeName== "#text") {
return window.getSelection().toString();
@KevCui
KevCui / dictcn.py
Last active October 29, 2017 09:18
Dict.cn en <-> cn CLI Python Script
#!/usr/bin/env python3
import sys
import requests
from bs4 import BeautifulSoup
if(len(sys.argv) < 2):
sys.exit(1)
r = requests.get('http://dict.cn/' + sys.argv[1])
r.encoding = 'utf-8'
@KevCui
KevCui / addNetworkConfig.sh
Created August 31, 2017 11:02
Allow proxy mock for Android 7
#!/bin/sh
root=$1
dir="$root/android/src/main/"
xml="$dir/res/xml/network_security_config.xml"
manifest="$dir/AndroidManifest.xml"
tmpfile="$manifest.tmp"
if [ ! -e $manifest ]; then
echo "File $manifest doesn't exist!"
@KevCui
KevCui / arch-linux-install
Last active September 30, 2017 20:27 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system
# Install ARCH Linux
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/download/
# Make USB flash installation media https://wiki.archlinux.org/index.php/USB_flash_installation_media
dd bs=4M if=/path/to/archlinux.iso of=/dev/sdX status=progress && sync
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# This assumes a wifi only system...
@KevCui
KevCui / userChrome.css
Last active November 19, 2017 10:53
Firefox UI customization
/* How/Where to edit userChrome.css https://i.redd.it/v7lkiqannojz.png */
@-moz-document url("chrome://browser/content/browser.xul") {
/* hide navigation bar */
#nav-bar {
display: none;
}
/* hover the bottom of tab bar to show navigation bar */
#navigator-toolbox:hover > #nav-bar{
display: -moz-box;
@KevCui
KevCui / remvoe-bloats-OP3T.sh
Last active March 31, 2018 10:23
OP3T bloat apps remover
#!/bin/sh
# TRY THIS ON YOUR OWN RISK!
# root needed
BLOAT_APP_LIST=(
YouTube
Videos
Photos
Drive
Duo
<resources>
<string name="app_name">Resplash</string>
<string name="navigation_drawer_open">打开导航抽屉</string>
<string name="navigation_drawer_close">关闭导航抽屉</string>
<string name="action_share">分享</string>
<string name="action_view_on_unsplash">在浏览器中打开</string>
<!-- ErrorView -->
@KevCui
KevCui / manifest.json
Created December 3, 2017 15:01
Post: Ship PWA Guided by Lighthouse
{
"short_name": "Kevin",
"name": "Krazy Kevin",
"icons": [
{
"src":"/images/favicons/android-icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
}
],
@KevCui
KevCui / sw.js
Created December 3, 2017 15:04
Post: Ship PWA Guided by Lighthouse
self.addEventListener('install', e => {
let timeStamp = Date.now();
e.waitUntil(
caches.open('kevin-blog').then(cache => {
return cache.addAll([
`/`,
`/#blog`,
`/css/uno.min.css`,
`/css/font.min.css`,
`/css/resume.min.css`,