Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
ʙʀɪɴɢ ᴛʜᴇ ғᴜᴛᴜʀᴇ sᴏᴏɴᴇʀ

ᴜɴᴋɴᴡᴏɴ unknwon

👨‍💻
ʙʀɪɴɢ ᴛʜᴇ ғᴜᴛᴜʀᴇ sᴏᴏɴᴇʀ
View GitHub Profile
@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!!!
View gist:9443995
; 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
You can’t perform that action at this time.