Skip to content

Instantly share code, notes, and snippets.

View yurenchen000's full-sized avatar
😶‍🌫️
may be slow to respond.

yurenchen000

😶‍🌫️
may be slow to respond.
View GitHub Profile
@yurenchen000
yurenchen000 / github_md_toc_maximize.md
Created December 29, 2022 15:22
github readme.md toc maximize

Recently github has a very cramped TOC size,
Some pages are very difficult to read.

this script (paste and run in browser F12)
help maximize the TOC div size.

//github readme.md toc maximize
with(document.querySelector('readme-toc .SelectMenu-modal.mt-1').style){
 maxHeight=(document.documentElement.clientHeight-40)+'px'
@fizzyade
fizzyade / Caddy 2 Cloudflare DNS Example.md
Last active March 25, 2024 22:58
An example of a Caddy 2 JSON configuration file for a reverse proxy that uses the Cloudflare DNS module
{
  "apps": {
    "http": {
      "servers": {
        "example": {
          "listen": [
            ":80",
            ":443"
          ],
@jasonzhouu
jasonzhouu / chinese_input_in_manjaro.md
Last active January 23, 2024 10:57
Config Chinese input method in Manjaro(Manjaro 配置中文输入法)

1. install packages

run:

yay -Syu adobe-source-han-sans-otc-fonts adobe-source-han-serif-otc-fonts 
yay -Syu fcitx fcitx-googlepinyin fcitx-im fcitx-configtool 

2. config environmental variables

sudo vim /etc/profile
@kuanghan
kuanghan / docker_lxc.md
Created January 3, 2019 18:41
Setting up docker to run in a PRIVILEGED LXC container

Setting up docker to run in a PRIVILEGED LXC container

Set up a privileged container

Create container

Let's call the container docker_test1.

$ sudo lxc-create -t download -n docker_test1
...
Follow the prompts on the screen to set up the new container.
@coin8086
coin8086 / using-proxy-for-git-or-github.md
Last active April 7, 2024 07:40
Use Proxy for Git/GitHub

Use Proxy for Git/GitHub

Generally, the Git proxy configuration depends on the Git Server Protocol you use. And there're two common protocols: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.

SSH Protocol

When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocol. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:

ProxyCommand nc -x localhost:1080 %h %p
@kylebebak
kylebebak / debounce.py
Last active August 30, 2023 12:46
Simple Python 3 debounce implementation
"""
@debounce(3)
def hi(name):
print('hi {}'.format(name))
hi('dude')
time.sleep(1)
hi('mike')
time.sleep(1)
http://invisible-island.net/xterm/
XTerm Control Sequences
Edward Moy
University of California, Berkeley
Revised by
@rccursach
rccursach / Gemfile
Last active October 4, 2023 13:08 — forked from daqing/Gemfile
redis_pubsub_demo.rb
source "https://rubygems.org"
gem 'eventmachine'
gem 'sinatra'
gem 'yajl-ruby', require: 'yajl'
gem 'thin'
gem 'em-websocket'
@jlacar
jlacar / format-xml-vi.md
Last active May 25, 2023 18:52
Format XML in vi using xmllint

Formatting XML in vi

Using xmllint

You can format XML in vi using xmllint

:%!xmllint "%" --format

Default indentation is 2 spaces. You can change that by assigning a value to the XMLLINT_INDENT environment variable. To do that without

@subfuzion
subfuzion / curl.md
Last active May 9, 2024 18:17
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.