Skip to content

Instantly share code, notes, and snippets.

Janlay Wu janlay

Block or report user

Report or block janlay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@janlay
janlay / README.md
Last active Dec 3, 2019
Delete and unfavorite tweets
View README.md

Delete and unfavorite tweets

This util deletes your historical tweets from a downloaded archive file, unfavorites tweets from your public profile.

No guarantee, no support, use it at your own risk.

Preparations

  1. Apply to become a Twitter developer first.
    Once your Twitter developer account application is approved, You can create a new app and get its Consumer API keys and generate Access token. These keys are used to configure tweet.sh.
  2. Obtain archived tweets by requesting to download your Twitter data.
    You can extract tweet.js file from the downloaded .zip file.
@janlay
janlay / msupdate.sh
Last active Dec 20, 2019
MSUpdate - manually update your Microsoft apps on macOS
View msupdate.sh
#!/bin/bash
# author: janlay@gmail.com
set -e
SERVICE_URL="https://officecdn.microsoft.com/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate"
USER_AGENT='Microsoft%20AU%20Daemon/4.13.19071800 CFNetwork/1098 Darwin/19.0.0 (x86_64)'
MS_APPS=(
"Microsoft AutoUpdate:0409MSau04"
@janlay
janlay / restore-dotfiles.sh
Created Apr 8, 2019
Restore dotfiles from Dropbox to Home directory
View restore-dotfiles.sh
#!/bin/bash
# author: janlay@gmail.com
# How to use this script:
# 1. To backup your dotfiles, move them to the WORKING_DIR.
# 2. To Restore the dotfiles you previously backed up, run this script.
WORKDING_DIR="$HOME/Dropbox/dotfiles"
echo "Working on $WORKDING_DIR"
@janlay
janlay / chinadns-updater.sh
Created Mar 25, 2019
ChinaDNS Updater for OpenWRT
View chinadns-updater.sh
#!/bin/bash
FILE=/etc/chinadns_chnroute.txt
TEMP_FILE="$FILE.tmp"
TELEGRAM_BOT=/root/scripts/telegram-bot
SOURCE="https://raw.githubusercontent.com/ym/chnroutes2/master/chnroutes.txt"
LOGFILE=/root/scripts/chinadns-updater.log
echo -e "\nChinaDNS Updater started at `date`." >> $LOGFILE
echo "Current routes: `wc -l "$FILE" | cut -d' ' -f1`." >> $LOGFILE
@janlay
janlay / archive-desktop.sh
Created Oct 10, 2016
Archive desktop files into yyyy-mm subdirectory
View archive-desktop.sh
filename=`basename "$1"`
[[ "$filename" == "Archive" ]] && exit 1
target=`stat -f '%Sc' -t '%Y-%m' "$1"`
fullpath="$HOME/Desktop/Archive/$target"
mkdir -p "$fullpath"
mv "$1" "$fullpath/"
script="display notification \"$filename -> Archive/$target\" with title \"Desktop file archived\""
osascript -e "$script"
@janlay
janlay / proxy.sh
Last active Mar 2, 2016
Toogle Proxy in command line
View proxy.sh
#!/bin/bash
# 1. source this file or append it to your bash/zsh profile.
# 2. modify https_proxy & http_proxy with your own proxy.
# 3. use `proxy on` to turn on proxy and `proxy off` to turn it off.
export PS1_backup=$PS1
function proxy () {
local prefix
@janlay
janlay / update-repos.sh
Last active Apr 16, 2019
Updates all Git repos in directory, defaults to Vim bundles.
View update-repos.sh
#!/bin/bash
# author: janlay@gmail.com
WORKDING_DIR="${1-$HOME/.vim/bundle}"
GIT_DIR_ROOT="$HOME/Workspace/.gitrepo"
echo "Working on $WORKDING_DIR"
for i in `find "$WORKDING_DIR" -mindepth 1 -maxdepth 1 -type d`; do
REPO_NAME="${i##*/}"
export GIT_WORK_TREE="$WORKDING_DIR/$REPO_NAME"
@janlay
janlay / README.md
Last active Jan 15, 2020
Yet another config for Surge.app
View README.md

Install

  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt Or run $ sh build-all to build all your index files.
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.

@janlay
janlay / wubi86.custom.yaml
Last active Mar 31, 2016
My custom Squirrel config especially created for Wubi86 users.
View wubi86.custom.yaml
patch:
switches:
- name: ascii_mode
reset: 0
states: [中文, 英文]
- name: full_shape
states: [半角, 全角]
- name: extended_charset
states: [通用, GBK]
- name: simplification
@janlay
janlay / whitelist.pac
Last active Apr 16, 2018
A white-list based PAC.
View whitelist.pac
/*
* A white-list based PAC without regexp, by @janlay
* It's just simple and fast.
* Last update: Oct 20, 2015
* Special thanks to @Paveo
*/
function FindProxyForURL(url, host) {
// REPLACE PROXY WITH YOUR OWN'S
var PROXY = "SOCKS 127.0.0.1:8801;SOCKS5 127.0.0.1:8801;PROXY 127.0.0.1:8800";
var BLACKHOLE = "127.0.0.2";
You can’t perform that action at this time.