Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Alan.He alanhg

🎯
Focusing
View GitHub Profile
@alanhg
alanhg / install-package-lrzsz.sh
Last active Jul 16, 2022
install-package-lrzsz.sh / shell
View install-package-lrzsz.sh
#!/bin/sh
# sudo sh -c "$(curl -fsSL https://gist.githubusercontent.com/alanhg/6a299b815f4dd3d242abc16b8be6b861/raw/dbe1497208f1d968ed8b67cad09c596e35c5be9c/install-package-lrzsz.sh)"
YUM_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)
APT_CMD=$(which apt)
PACKAGE=lrzsz
if [ ! -z $YUM_CMD ]; then
yum install -y $PACKAGE
@JamesHopbourn
JamesHopbourn / 含参数的 URL Scheme 收集.md
Last active Sep 20, 2022
含参数的 URL Scheme 收集.md
View 含参数的 URL Scheme 收集.md

URL Scheme 数据清洗命令

cat AndroidManifest.xml|perl -ne 'print if /<data android:host=/'|
perl -pe 's/^.*<data android:host="(.*?)" android:path="(.*?)" android:scheme="(.*?)"\/>/\3:\/\/\1\2/'|
perl -pe 's/^.*<data android:host="(.*?)" android:scheme="(.*?)"\/>/\2:\/\/\1/'|
perl -pe 's/^.*<data android:host="(.*?)" android:pathPrefix="(.*?)" android:scheme="(.*)"\/>/\3:\/\/\1\2/'|
perl -pe 's/^.*<data android:host="(.*?)" android:pathPattern="(.*?)" android:scheme="(.*)"\/>/\3:\/\/\1\2/' > ' URL Scheme.txt'

淘宝

@vookimedlo
vookimedlo / macos_mute_unmute.md
Last active Apr 15, 2022
MacOS: mute & unmute from command line
View macos_mute_unmute.md

Mute volume

osascript -e "set volume with output muted"

Unmute volume

osascript -e "set volume without output muted"
@JBlond
JBlond / bash-colors.md
Created Jul 24, 2017 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.
View bash-colors.md

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@rambolee
rambolee / update-dnsmasq-from-gfwlist.py
Last active Aug 9, 2022
升级 小米路由器3 可以ssh 可以 Shadowsocks [Tags]: 小米路由, 小米路由3, 小米路由器, 小米路由器3, ssh, shadowsocks
View update-dnsmasq-from-gfwlist.py
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@parisk
parisk / default.js
Last active Jul 18, 2022
xterm.js keyMap
View default.js
/**
* Example keymap for usage in xterm.js
* Original issue: https://github.com/sourcelair/xterm.js/issues/487
*/
// We export this as default, since the only thing we care about
// is the contents of the keymap. No classes, methods or anything
// else is expected.
export default let keyMap =
@condran
condran / FeignClientWithPATCH.md
Last active May 30, 2022
Spring Cloud Netflix with PATCH (client side)
View FeignClientWithPATCH.md

Spring Cloud Netflix with PATCH (client side)

I have been researching Spring Boot and Spring Cloud, there are lots of goodies here but as with all technology there are gotchas.

Feign Client does not support PATCH out of the box! ಠ_ಠ ... ಠ~ಠ ... ⊙︿⊙

You might see an error like this if you try to use RequestMethod.PATCH in your @FeignClient interface: java.net.ProtocolException: Invalid HTTP method: PATCH

I am using the current versions:

@kolodny
kolodny / proxy.js
Created Jan 4, 2016 — forked from cmawhorter/proxy.js
Node script to forward all http requests to another server and return the response with an access-control-allow-origin header. Follows redirects.
View proxy.js
// Simple proxy/forwarding server for when you don't want to have to add CORS during development.
// Usage: node proxy.js
// Open browser and navigate to http://localhost:9100/[url]
// Example: http://localhost:9100/http://www.google.com
// This is *NOT* for anything outside local development. It has zero error handling among other glaring problems.
// This started as code I grabbed from this SO question: http://stackoverflow.com/a/13472952/670023
@squarism
squarism / iterm2.md
Last active Sep 26, 2022
An iTerm2 Cheatsheet
View iterm2.md

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)