Skip to content

Instantly share code, notes, and snippets.

View unknwon's full-sized avatar
🏇
路虽远,行则将至。事虽难,做则可成。

Joe Chen unknwon

🏇
路虽远,行则将至。事虽难,做则可成。
View GitHub Profile
@unknwon
unknwon / go.mod
Last active March 10, 2022 09:16
Transparent HTTP proxy server in Go
module goproxy
go 1.17
require (
github.com/elazarl/goproxy v0.0.0-20220115173737-adb46da277ac
github.com/elazarl/goproxy/ext v0.0.0-20220115173737-adb46da277ac
)
@unknwon
unknwon / main.go
Created October 24, 2020 07:59
Move s3 files between directories
package main
import (
"fmt"
"log"
"os"
"path"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
@unknwon
unknwon / chrome.sh
Last active March 5, 2019 17:37
[Single Page Chrome Window] #Archive
#! /bin/bash
URL=$1
if [ -z "$URL" ]; then
echo "Please enter an URL: "
read URL
fi
if [[ $URL != http://* && $URL != https://* ]]; then
URL="http://$URL"

Keybase proof

I hereby claim:

  • I am unknwon on github.
  • I am unknwon (https://keybase.io/unknwon) on keybase.
  • I have a public key ASBCrPsvKjbtJGuoh-dcI-k4KiD5cDbks_i70U-HOJw6kAo

To claim this, I am signing this object:

yum install -y libpng
yum install -y libjpeg
yum install -y openssl
yum install -y icu
yum install -y libX11
yum install -y libXext
yum install -y libXrender
yum install -y xorg-x11-fonts-Type1
yum install -y xorg-x11-fonts-75dpi
package main
import (
"fmt"
"log"
)
var printFn = func(idx int, bean interface{}) error {
fmt.Printf("%d: %#v\n", idx, bean.(*Account))
return nil
package main
import (
"fmt"
)
const prompt = `Please enter number of operation:
1. Create new account
2. Show detail of account
3. Deposit
package main
import (
"fmt"
)
const prompt = `Please enter number of operation:
1. Create new account
2. Show detail of account
3. Deposit
func getReposFiles(userName, repoName, commitId string, rpath string) ([]*RepoFile, error) {
repo, err := git.OpenRepository(RepoPath(userName, repoName))
if err != nil {
return nil, err
}
commit, err := repo.GetCommit(commitId)
if err != nil {
return nil, err
}
; Google
google=www.google.com
search=http://%(google)s
; Here are Comments
; Second line
[Demo]
# This symbol can also make this line to be comments
key1=Let's us goconfig!!!