Skip to content

Instantly share code, notes, and snippets.

View symant233's full-sized avatar
🍀

怀瑾 symant233

🍀
  • Kingsoft Office
  • Wuhan, China
  • 07:39 (UTC +08:00)
View GitHub Profile
@Victrid
Victrid / gitgraft.sh
Created August 29, 2022 17:09
Find which commit your no-git friend is working on and generate patches for attaching their works onto git tree.
#!/bin/bash
hash git 2>/dev/null || { echo >&2 "Required command 'git' is not installed. ( hmm... why are you using this? ) Aborting."; exit 1; }
hash realpath 2>/dev/null || { echo >&2 "Required command 'realpath' is not installed. Aborting."; exit 1; }
hash pwd 2>/dev/null || { echo >&2 "Required command 'pwd' is not installed. Aborting."; exit 1; }
hash cd 2>/dev/null || { echo >&2 "Required command 'cd' is not installed. Aborting."; exit 1; }
hash echo 2>/dev/null || { echo >&2 "Required command 'echo' is not installed. Aborting."; exit 1; }
hash mv 2>/dev/null || { echo >&2 "Required command 'mv' is not installed. Aborting."; exit 1; }
hash diff 2>/dev/null || { echo >&2 "Required command 'diff' is not installed. Aborting."; exit 1; }
hash diffstat 2>/dev/null || { echo >&2 "Required command 'diffstat' is not installed. Aborting."; exit 1; }
@namdau
namdau / vue-nginx.conf
Created July 31, 2017 18:04
Nginx config for Vuejs project with an API upstream
server {
server_name default_server;
# This is for Let's Encrypt certification renewal
include /etc/nginx/snippets/letsencrypt.conf;
# Redirect to https
location / {
return 301 https://$server_name$request_uri;
}
}
@uhop
uhop / nginx-webp-sample.conf
Last active November 3, 2023 12:09
Serving WEBP with nginx conditionally.
user www-data;
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
@longbill
longbill / socks5.js
Last active March 28, 2024 03:37
Socks5 proxy server in pure javascript
const net = require('net')
net.createServer(client => {
client.once('data', data => {
client.write(Buffer.from([5, 0]));
client.once('data', data => {
data = [...data];
let ver = data.shift();
let cmd = data.shift(); //1: connect, 2: bind, 3: udp
let rsv = data.shift();
@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active April 15, 2024 17:23
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)