Skip to content

Instantly share code, notes, and snippets.

View locona's full-sized avatar
:octocat:
On vacation

Miyamae Yuuya locona

:octocat:
On vacation
View GitHub Profile
@locona
locona / context.md
Last active May 10, 2017 03:50
Gin読書会

Gin 読書会

Context

  • writermem: responseWriter
  • Request: *http.Request
  • Writer: ResponseWriter
  • Params: Params
  • handlers: HandlersChain
func convertToResult(rows *sql.Rows) (res [][]interface{}, err error) {
columns, err := rows.Columns()
if err != nil {
return nil, err
}
values := make([]sql.RawBytes, len(columns))
args := make([]interface{}, len(values))
for i := range values {
@locona
locona / dummy.go
Last active May 17, 2018 02:26
dummy data of csv format
package main
type A struct {
id string
name string
age string
time string
c00 string
c11 string
c12 string
package main
import (
"fmt"
"io/ioutil"
"os"
"strings"
"text/template"
// "html/template"
package main
func camelCase(s string) string {
s = strings.TrimSpace(s)
buffer := make([]rune, 0, len(s))
var prev rune
for _, curr := range s {
if !isDelimiter(curr) {
if isDelimiter(prev) || (prev == 0) {
package main
import (
"fmt"
"go/ast"
"reflect"
"regexp"
"strings"
"time"
package main
import (
"io/ioutil"
"github.com/k0kubun/pp"
yaml "gopkg.in/yaml.v2"
)
type Data struct {
curl ipinfo.io/ip
<Card style={{ marginLeft: '64px' }}>
<PageHeader
position="static"
color="default"
>
<Toolbar style={{ width: '30%' }}>
<Typography variant="title" color="inherit" style={{ minWidth: '220px' }}>
</Typography>
<TrackingWebNew handleSubmit={handleSubmit} />
@locona
locona / dir.go
Created June 27, 2018 08:04
dir/* path list
dir := "./hour=05"
files, err := ioutil.ReadDir(dir)
if err != nil {
panic(err)
}
var paths []string
for idx := range files {
paths = append(paths, filepath.Join(dir, files[idx].Name()))
}