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 / install-burp-cert-on-android.sh
Last active January 14, 2024 20:02
Install Burp Suite certificate on Android device
#!/usr/bin/env bash
#
# Install Burp Suite certificate on Android device
#
# Usage:
# ./install-burp-cert-on-android.sh
# Or
# ./install-burp-cert-on-android.sh <exported_burp_cert_der_file>
# Precondition:
@KevCui
KevCui / github-hide-release-info.user.js
Last active June 20, 2021 09:01
Hide release activity on personal GitHub dashboard
// ==UserScript==
// @name Github Hide Release Info
// @description Hide relaese activity on personal GitHub dashboard
// @author KevCui
// @match https://github.com/
// @grant none
// ==/UserScript==
function hideReleaseInfo() {
var elems = document.getElementsByClassName('release');
@KevCui
KevCui / github-square-avatar.user.js
Created October 27, 2020 09:22
Change circle GitHub avatars to square ones
// ==UserScript==
// @name GitHub Square Avatar
// @author KevCui
// @match https://*.github.com/*
// @grant none
// ==/UserScript==
function changeAvatarStyle() {
var style = document.createElement('style');
style.type = 'text/css';
@KevCui
KevCui / hotspot.sh
Last active January 17, 2021 12:34
Show COVID-19 7-days incidence of a specific location in Germany
#!/usr/bin/env sh
#
# Show COVID-19 7-days incidence of a specific location in Germany
# Data fetched from https://hotspotornot.de/
#
#/ Usage:
#/ ./hotspot.sh <location_name|postcode>
#/
#/ Examples:
#/ $ ./hotspot.sh berlin
@KevCui
KevCui / jsonfaker.py
Last active August 21, 2020 12:48
Generate mock json data with a structured template using Faker under the hood
#!/usr/bin/python3
# ~$ ./jsonfaker.py <json_template>
import sys
import re
from faker import Faker
from faker.providers import BaseProvider
class customProvider(BaseProvider):
@KevCui
KevCui / font-test.txt
Created July 25, 2020 07:55
A text file used to test font
The quick brown fox jumps over the lazy dog
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
i1Il|L 80Oo 5S bhn ([{<>}]) \*+-–—/!?:;.,@=~^%$ __# "q" 'q' “q” ‘q’
±…×·
var sum = 0;
for (var i=0; i<arr.length; i++){
sum += arr[i];
};
@KevCui
KevCui / pocket-compact.user.js
Last active December 18, 2020 20:07
User style which makes Pocket list view more compact
// ==UserScript==
// @name Pocket Compact
// @author KevCui
// @include https://app.getpocket.com/*
// @run-at document-idle
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
@KevCui
KevCui / simpleuploader.py
Created July 12, 2020 09:15
Simple Python File Upload Server
#!/usr/bin/env python3
# ./simpleuploder.py [<port>]
import socketserver
import http.server
import cgi
import os
from sys import argv
@KevCui
KevCui / 1to50.js
Created April 13, 2020 12:24
Complete 1to50 challenge with puppeteer https://twitter.com/fltoledo/status/1248789014632476672
const puppeteer = require('puppeteer-core');
(async() => {
const cPath = '/usr/bin/chromium';
const isHeadless = true;
const url = 'http://zzzscore.com/1to50/en';
const browser = await puppeteer.launch({executablePath: cPath, headless: isHeadless});
const page = await browser.newPage();
await page.goto(url, {timeout: 30000, waitUntil: 'domcontentloaded'});
@KevCui
KevCui / nCoVstatus.sh
Created February 5, 2020 07:55
Show Coronavirus 2019-nCoV global status in terminal
#!/usr/bin/env bash
# Data fetched from the dashboard "Coronavirus 2019-nCoV Global Cases" https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6
echo "Country/Region: Confirmed / Deaths / Recovered"
curl -sS 'https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/2/query?f=json&where=1%3D1&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&orderByFields=Confirmed%20desc&resultOffset=0&resultRecordCount=250&cacheHint=true' | jq -r '.features[].attributes | "\(.Country_Region)+\(.Confirmed)+\(.Deaths)+\(.Recovered)"' | column -t -s '+'
echo -e "\n"
curl -sS 'https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/1/query?f=json&where=1%3D1&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&outStatistics=%5B%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22Confirmed%22%2C%22outStatisticFieldName%22%3A%22value%22%7D%5D&cacheHint=true' | jq -r '"