Skip to content

Instantly share code, notes, and snippets.

View u110's full-sized avatar
💭
👍

Yuu Ito u110

💭
👍
View GitHub Profile
FROM postgres:14
ENV POSTGRES_PASSWORD=postgres
ENV POSTGRES_USER=postgres
# Fixed ownership and mode
RUN chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
RUN chmod 740 /etc/ssl/private/ssl-cert-snakeoil.key
CMD ["-c", "ssl=on", "-c", "ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem", "-c", "ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key"]
# https://twitter.com/hiroysato/status/1339925551167893504
FROM openjdk:8-slim
ENV LANG=C.UTF-8 \
PATH_TO_EMBULK=/opt/embulk \
PATH=${PATH}:/opt/embulk
# Change timezone
RUN ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
with subset as (
select '123−4567' as x union all -- 123−4567
select '㌶' as x union all -- ヘクタール
select '㈱㈲' as x union all -- (株)(有)
select 'アイウエオABCabc①' as x union all -- アイウエオabcabc1
select '〒〠〶' as x union all -- 〒〠〒
select '()()' as x union all -- ()()
select 'ABCabc'
)
select x,
package main
import (
"context"
"fmt"
"cloud.google.com/go/bigquery"
)
// Item represents a row item.
package transformer
import (
"bufio"
"encoding/csv"
"encoding/json"
"fmt"
"io"
"os"
)
@u110
u110 / bq_with_context.go
Last active February 23, 2020 04:42
gcloud sdk go と context(cancel, timeout)の動作
package main
import (
"cloud.google.com/go/bigquery"
"context"
"fmt"
"google.golang.org/api/iterator"
"log"
"os"
"time"
package main
import (
"encoding/csv"
"encoding/json"
"fmt"
"io"
"log"
"strings"
)
package main
import (
"encoding/json"
"errors"
"io/ioutil"
"log"
)
type Runner interface {
package main
import (
"cloud.google.com/go/bigquery"
"context"
"fmt"
"google.golang.org/api/option"
)
func showBqDatasets() {
package main
import (
"fmt"
"math/rand"
"time"
)
func Swap(arr *[]int, i int, j int) {
(*arr)[i], (*arr)[j] = (*arr)[j], (*arr)[i]