Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
Typing...

William Li williamli

⌨️
Typing...
View GitHub Profile
@williamli
williamli / NordVPN - Launch and Hide.scpt
Created Jul 11, 2020
AppleScript to launch and hide NordVPN.app
View NordVPN - Launch and Hide.scpt
tell application "NordVPN"
activate
tell application "System Events" to keystroke "w" using {command down}
end tell
delay 0.5
tell application "NordVPN"
activate
tell application "System Events" to keystroke "w" using {command down}
end tell
View StevenBlack - hosts 4fa04707 additions
0.0.0.0 best2019-games-web4.com
0.0.0.0 www.xmeeting.com
0.0.0.0 xmeeting.com
0.0.0.0 www.ipuss.tv
0.0.0.0 hitboom.net
0.0.0.0 www.playamo.com
# Last modified: 13 Jan 2020 14:53 UTC+7
# Version: 2001131453
# Blocked: 1,345 domains
0.0.0.0 debet.com
@williamli
williamli / bitbucket-pipeline.yml
Last active Aug 21, 2019
GitHub Actions with GCloud credentials passed around as artifacts vs Bitbucket Pipeline and Google Cloud Build. https://twitter.com/_wli/status/1164038895614353408?s=20
View bitbucket-pipeline.yml
options:
docker: true
pipelines:
branches:
master:
- step:
image: google/cloud-sdk:latest
name: Deploy to Production
deployment: production
caches:
@williamli
williamli / randomDictionaryWordsCode.liquid
Last active Jun 8, 2019
Zendesk Macros - Generates a 5-dictionary-words random code from ticket ID (up to 5 digits) and a random number based on current timestamp.
View randomDictionaryWordsCode.liquid
// Generates a 5-dictionary-words random code from ticket ID (up to 5 digits) and a random number based on current timestamp.
// This sample comes loaded with 500 random dictionary words.
{% assign words = "annoyed, old-fashioned, rhyme, brief, powder, celery, fragile, number, flow, goofy, plastic, deserve, mother, invite, chief, opposite, numerous, sleet, soup, humorous, shelter, superb, receptive, treat, obey, knowing, wash, afford, ban, order, wave, employ, devilish, ripe, destruction, tree, hat, use, uninterested, materialistic, frantic, receipt, alleged, sack, station, entertain, nasty, week, cause, bucket, lazy, abject, juice, disagreeable, acid, seashore, tender, flagrant, garrulous, shrill, vague, bed, sour, curly, lame, delay, land, play, obsolete, immense, upset, extra-small, committee, absorbed, nondescript, shiver, languid, irate, zephyr, whistle, motionless, alcoholic, spiteful, damaged, swanky, blood, pollution, sheep, lake, punish, check, space, need, engine, plough, fairies, tomatoes, run,
View TL;DR.md
View colorize.js
// https://30secondsofcode.org/node
module.exports = (...args) => ({
black: `\x1b[30m${args.join(' ')}`,
red: `\x1b[31m${args.join(' ')}`,
green: `\x1b[32m${args.join(' ')}`,
yellow: `\x1b[33m${args.join(' ')}`,
blue: `\x1b[34m${args.join(' ')}`,
magenta: `\x1b[35m${args.join(' ')}`,
@williamli
williamli / cloudbuild-deploy.yaml
Created Feb 16, 2019
Google Cloud Build with GitHub plugin
View cloudbuild-deploy.yaml
steps:
# Decrypt the file containing the key
- name: 'gcr.io/cloud-builders/gcloud'
args: ...
@williamli
williamli / ssh-key-generation.md
Created Dec 5, 2018 — forked from cybersamx/ssh-key-generation.md
Generate a new SSH key pair
View ssh-key-generation.md

Mac and Linux

  • Open Terminal

  • Check if you already have a SSH keypair generated. Do the following:

    $ ls -la ~/.ssh/id_rsa*
    

    If the files exist, you already have SSH installed. IMPORTANT: But if you wish to regenerate the SSH key pair, at least back up your old SSH keys.

@williamli
williamli / Baidu TongJi + China Firewall = DDOS "Great Cannon"
Last active Aug 25, 2017
Baidu TongJi's Javascript Library (//hm.baidu.com/hm.js) Changes (by Firewall of China) to launch DDOS attack on enemy websites?
View Baidu TongJi + China Firewall = DDOS "Great Cannon"
The Great Firewall of China seems to be hijacking Baidu Analytics (TongJi)'s Javascript code,
launching DDOS attacks on enemy websites from browsers.
Different hm.js (TongJi library) libraries are spotted and load interchangably.
An altered hm.js code is used when DDOS is observed.
More Info: https://stackoverflow.com/questions/45874555/baidu-tongji-analytics-is-directing-browsers-to-ddos-chinas-enemies
@williamli
williamli / easings.scss
Created Aug 3, 2017
Easings variables for SCSS
View easings.scss
// taken from http://easings.net/
$ease-in-out-back: cubic-bezier(0.680, -0.550, 0.265, 1.550);
$ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.150, 0.860);
$ease-in-out-expo: cubic-bezier(1.000, 0.000, 0.000, 1.000);
$ease-in-out-sine: cubic-bezier(0.445, 0.050, 0.550, 0.950);
$ease-in-out-quint: cubic-bezier(0.860, 0.000, 0.070, 1.000);
$ease-in-out-quart: cubic-bezier(0.770, 0.000, 0.175, 1.000);
$ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1.000);
$ease-in-out-quad: cubic-bezier(0.455, 0.030, 0.515, 0.955);
You can’t perform that action at this time.