Skip to content

Instantly share code, notes, and snippets.

View geekdada's full-sized avatar

Roy Li geekdada

View GitHub Profile
;(async () => {
const headers = $request.headers
delete headers['user-agent']
delete headers['sec-ch-ua-full-version']
delete headers['sec-ch-ua-full-version-list']
headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41'
headers['sec-ch-ua'] = '"Chromium";v="110", "Not A(Brand";v="24", "Microsoft Edge";v="110"'
headers['sec-ch-ua-mobile'] = '?0'
@geekdada
geekdada / script.js
Last active March 4, 2022 20:46
GoodLinks Script
(function() {
const scheme = 'goodlinks://x-callback-url/save'
const search = new URLSearchParams()
search.append('url', document.URL)
window.open(`${scheme}?${search.toString()}`)
})()
@geekdada
geekdada / clash.list
Created April 30, 2020 03:02
Clash demo
---
proxies:
- name: "\U0001F1ED\U0001F1F0 香港 Azure 01"
type: ss
server: example.com
port: 80
cipher: aes-128-gcm
password: password1
udp: true
plugin: obfs
@geekdada
geekdada / weibo_ads_remover.sgmodule
Last active April 17, 2020 17:58
Weibo Ads Remover
#!name=Weibo Ads Remover
#!desc=Weibo Ads Remover
#!system=ios
# Source https://github.com/yichahucha/surge/tree/master
[Script]
http-response ^https?://(sdk|wb)app\.uve\.weibo\.com(/interface/sdk/sdkad.php|/wbapplua/wbpullad.lua) requires-body=1,script-path=https://raw.githubusercontent.com/yichahucha/surge/master/wb_launch.js
http-response ^https?://m?api\.weibo\.c(n|om)/2/(statuses/(unread|extend|positives/get|(friends|video)(/|_)(mix)?timeline)|stories/(video_stream|home_list)|(groups|fangle)/timeline|profile/statuses|comments/build_comments|photo/recommend_list|service/picfeed|searchall|cardlist|page|!/photos/pic_recommend_status|video/tiny_stream_video_list) requires-body=1,script-path=https://raw.githubusercontent.com/yichahucha/surge/master/wb_ad.js
@geekdada
geekdada / index.js
Last active November 4, 2019 02:33
Deploy Surgio gateway to my own server
const gateway = require('surgio/build/gateway');
const http = require('http');
http.createServer(gateway.createHttpServer()).listen(9000, () => {
console.log('Your app is running at http://127.0.0.1:9000');
});
@geekdada
geekdada / handler.js
Created November 4, 2019 02:21
Deploy Surgio gateway to Azure Function
const createHandler = require("azure-function-express").createHandler;
const gateway = require("surgio/build/gateway");
// Binds the express app to an Azure Function handler
module.exports = createHandler(gateway.createHttpServer());
@geekdada
geekdada / hulu_ads_script.js
Created July 18, 2019 06:50
Redirect Hulu ads
let headers = $response.headers;
headers['Location'] = 'https://dada-oss.dacdn.top/teehee-network-files/block.mp4';
$done({
status: 301,
headers,
});
@geekdada
geekdada / delete_branches_older_than.sh
Last active December 3, 2018 05:45 — forked from redthor/delete_branches_older_than.sh
Script to delete branches older than a certain date, modification of 4586456
# Copy of https://gist.github.com/antonio/4586456
# With a modification to collect all the branch names so we can make one git request
# Set DRY_RUN=1 to get an echo of the command
# Format that works with `git log --since`, e.g. 2018-01-01
date=$1
branches=
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/remotes\///' | grep feature | grep -v 'master$'); do
if [[ "$(git log $branch --since $date | wc -l)" -eq 0 ]]; then
@geekdada
geekdada / get-keys-for-github-user.sh
Created February 13, 2017 15:50 — forked from rtlong/get-keys-for-github-user.sh
Put public keys for a github user in ~/.ssh/authorized keys with mucho ease
IFS="$(printf '\n\t')"
mkdir -p ~/.ssh
if ! [[ -f ~/.ssh/authorized_keys ]]; then
echo "Creating new ~/.ssh/authorized_keys"
touch ~/.ssh/authorized_keys
fi
user=$1
### Keybase proof
I hereby claim:
* I am geekdada on github.
* I am geekdada (https://keybase.io/geekdada) on keybase.
* I have a public key whose fingerprint is 7395 FE13 1689 A44A 170A 5867 1880 F8C1 41E4 8CE1
To claim this, I am signing this object: