Skip to content

Instantly share code, notes, and snippets.

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

Joe Chen unknwon

🏇
路虽远,行则将至。事虽难,做则可成。
View GitHub Profile
; Comments can start with semicolon
# Or pound sign
key_default = This value will be overwritten
# This is the comment of super section, all the white spaces will be delete when it's parsing
[super]
# This is the comment of key_super
key_super = a normal key-value pair
; 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!!!
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
}
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
package main
import (
"fmt"
"log"
)
var printFn = func(idx int, bean interface{}) error {
fmt.Printf("%d: %#v\n", idx, bean.(*Account))
return nil
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

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:

@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"
@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"