Skip to content

Instantly share code, notes, and snippets.

View dulao5's full-sized avatar

Du Zhigang (ト シゴウ) dulao5

View GitHub Profile
@dulao5
dulao5 / convert_underscore_case_to_camelCase_variables.sh
Last active February 23, 2018 05:49
convert_underscore_case_to_camelCase_variables.sh
#!/bin/sh
#===============================================================================
#
# USAGE: convert_underscore_case_to_camelCase_variables.sh <file名>
#
# DESCRIPTION: PHPファイルの underscore_case 変数名を camelCase に自動に変換する
#
#===============================================================================
set -o nounset
git:(master) git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short | grep ^\* | grep 'Merge pull request'
git diff b32e180d^ 73241c26 --name-only
package main
import (
"fmt"
"reflect"
)
func main() {
vars := []interface{}{"1", "2", "3", "4", "5"}
fmt.Println(vars)
@dulao5
dulao5 / slice-append-cap.go
Created August 20, 2018 02:39
golang: slice append and cap
package main
import "fmt"
func main() {
slice := []int{1}
fmt.Printf("%v , len: %v , cap: %v\n", &slice[0], len(slice), cap(slice))
// from https://yar999.gitbooks.io/gopl-zh/content/ch8/ch8-04.html
// gopl.io/ch8/pipeline3
package main
import (
"fmt"
//"sync"
)
@dulao5
dulao5 / concurrency.go
Last active September 2, 2018 06:58
golang concurrency exercise
// https://talks.golang.org/2012/concurrency.slide#36
package main
import (
"fmt"
"math/rand"
"time"
)
type Message struct {
@dulao5
dulao5 / install.sh
Last active September 6, 2018 13:18
Macos : python3 + virtualenv + tensorflow
brew upgrade python3
pip3 install --upgrade pip setuptools wheel
pip3 install --upgrade virtualenv
virtualenv --system-site-packages -p python3 tensorflow
cd tensorflow
source ./bin/activate
# 後: https://www.tensorflow.org/install/install_mac
pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.1-py3-none-any.whl
@dulao5
dulao5 / 1.sharemem.go
Last active September 7, 2018 03:41
golang-sharemem
// https://golang.org/doc/codewalk/sharemem/
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"log"
@dulao5
dulao5 / 00.learn Architectural.md
Last active November 20, 2020 01:10
Fielding, Roy Thomas. Architectural Styles and the Design of Network-based Software Architectures. Doctoral dissertation, University of California, Irvine, 2000.

基本概念

image

2.2 評価

評価 image 追加スタイル image

@dulao5
dulao5 / 01.md
Last active January 25, 2019 10:51
kubernetes basic Tutorials