Skip to content

Instantly share code, notes, and snippets.

Avatar
👣
ᴏɴ ᴛʜᴇ ᴘᴀᴛʜ ᴛᴏ ғʀᴇᴇᴅᴏᴍ

ᴜɴᴋɴᴡᴏɴ unknwon

👣
ᴏɴ ᴛʜᴇ ᴘᴀᴛʜ ᴛᴏ ғʀᴇᴇᴅᴏᴍ
View GitHub Profile
@unknwon
unknwon / main.go
Created Oct 24, 2020
Move s3 files between directories
View main.go
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 Mar 5, 2019
[Single Page Chrome Window] #Archive
View chrome.sh
#! /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"
View keybase.md

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:

View Install wkhtmltopdf on CentOS7
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
View go_tips.md

Convert []uint to int64

int64(binary.LittleEndian.Uint64(data[pos:pos+8]))
int64(binary.BigEndian.Uint64(data[pos:pos+8]))

Get Windows version

View gist:a7c9162bce3f20d3bee6
package main
import (
"fmt"
"log"
)
var printFn = func(idx int, bean interface{}) error {
fmt.Printf("%d: %#v\n", idx, bean.(*Account))
return nil
View gist:861dfa5107c6e9a65974
package main
import (
"fmt"
)
const prompt = `Please enter number of operation:
1. Create new account
2. Show detail of account
3. Deposit
View gist:03c4e9dec8ea97b3a010
package main
import (
"fmt"
)
const prompt = `Please enter number of operation:
1. Create new account
2. Show detail of account
3. Deposit
View gist:10410664
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
}
View gist:9444000
; 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!!!