Skip to content

Instantly share code, notes, and snippets.

@hiroosak
hiroosak / Dockerfile
Last active August 11, 2019 01:30
php laravel installer
FROM php:7.3
RUN apt-get update
RUN apt-get install -y zlib1g-dev libzip-dev \
&& docker-php-ext-install zip
# Install composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
@hiroosak
hiroosak / chain.go
Created July 6, 2015 23:49
chain sample
package main
import "log"
type t1 struct {
s string
}
func foo(i interface{}) (interface{}, error) {
return t1{"hello"}, nil
@hiroosak
hiroosak / app.go
Last active August 29, 2015 14:22
array_to_json
package main
import (
"database/sql"
"database/sql/driver"
"encoding/json"
_ "github.com/lib/pq"
gorp "gopkg.in/gorp.v1"
)
package main
import (
"database/sql"
"encoding/json"
"fmt"
"github.com/davecgh/go-spew/spew"
"github.com/go-gorp/gorp"
_ "github.com/lib/pq"
@hiroosak
hiroosak / aerospike.conf
Created May 29, 2015 09:39
aerospike.conf
# Aerospike database configuration file.
# This stanza must come first.
service {
user root
group root
paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
pidfile /var/run/aerospike/asd.pid
service-threads 4
transaction-queues 4
package main
import (
"encoding/json"
"github.com/xeipuuv/gojsonschema"
"fmt"
)
package main
import (
"encoding/json"
"fmt"
simpleJson "github.com/bitly/go-simplejson"
)
type User struct {
@hiroosak
hiroosak / main.go
Created December 13, 2014 13:11
json unmarshal test
package main
import (
"encoding/json"
"fmt"
scan "github.com/mattn/go-scan"
)
type User struct {
@hiroosak
hiroosak / main.go
Last active August 29, 2015 14:11
benchmark json libraries
package main
import (
"encoding/json"
"fmt"
"github.com/antonholmquist/jason"
simpleJson "github.com/bitly/go-simplejson"
scan "github.com/mattn/go-scan"
)
package main
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"net/http/httputil"