Skip to content

Instantly share code, notes, and snippets.

View alanhg's full-sized avatar
⌨️
Focusing

Alan.He alanhg

⌨️
Focusing
View GitHub Profile
@alanhg
alanhg / install-package-lrzsz.sh
Last active July 16, 2022 08:41
install-package-lrzsz.sh / shell
#!/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
@xmlking
xmlking / curl-with-http3-macos.md
Created December 4, 2021 20:09
Installing curl with http3 on MacOS

Work-in-pogress

Ref: cloudflare/homebrew-cloudflare#21

 # Clean up any old version of curl you may have already tried to install
brew remove -f curl

# Download the curl ruby install script provided by cloudflare
@clarkb7
clarkb7 / unicode.md
Last active August 29, 2022 19:43
A guide to character encoding aware development
@vookimedlo
vookimedlo / macos_mute_unmute.md
Last active February 23, 2024 12:17
MacOS: mute & unmute from command line

Mute volume

osascript -e "set volume with output muted"

Unmute volume

osascript -e "set volume without output muted"
@JBlond
JBlond / bash-colors.md
Last active April 23, 2024 00:02 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

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 September 22, 2023 09:48
升级 小米路由器3 可以ssh 可以 Shadowsocks [Tags]: 小米路由, 小米路由3, 小米路由器, 小米路由器3, ssh, shadowsocks
#!/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 July 18, 2022 14:24
xterm.js keyMap
/**
* 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 19:18
Spring Cloud Netflix with PATCH (client side)

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 January 4, 2016 02:23 — 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.
// 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