Skip to content

Instantly share code, notes, and snippets.

View bcho's full-sized avatar
💍
一起来发财吧!Let's make some money!

hbc bcho

💍
一起来发财吧!Let's make some money!
View GitHub Profile
package main
import (
"encoding/binary"
"fmt"
"net"
"os"
"unsafe"
"golang.org/x/sys/unix"
@bcho
bcho / docker-build.sh
Created August 22, 2019 13:58
docker image building with semantic tag
#!/usr/bin/bash
set -e
TAG="$1"
if [[ -z "$TAG" ]]
then
date_version=$(date "+%Y%m%d")
head_commit=$(git rev-parse --short HEAD)
package main
import (
"fmt"
"os"
"path/filepath"
"time"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@bcho
bcho / meta-tags.md
Created October 12, 2016 06:44 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
# coding: utf-8
import re
LEVEL_PATTERN = re.compile(r'''
([\|\-` ]*) # match level
(.*) # match remains
''', re.X)
@bcho
bcho / event_server.go
Created February 12, 2016 12:17
trick
package main
import "fmt"
type ev struct {
target interface{}
returnValue interface{}
c chan error
}
@bcho
bcho / xiami.py
Created July 20, 2015 14:32
trick
'''A simple script for extracting xiami song url.'''
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote
def decode(location):
encoded = location[1:]
@bcho
bcho / m.go
Created July 11, 2015 13:29
trick
// A cancellable job runner prototype.
package main
import (
"fmt"
"math/rand"
"time"
)
func worker(id int, cancel chan interface{}, done chan int) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.