Skip to content

Instantly share code, notes, and snippets.

@sekky0905
sekky0905 / file0.go
Last active May 29, 2018 02:59
忘れがちなGo言語の書式指定子を例付きでまとめた ref: http://qiita.com/Sekky0905/items/c9cbda2498a685517ad0
package main
import (
"fmt"
)
type Person struct {
Name string
Favorite string
}
@sekky0905
sekky0905 / file0.txt
Last active May 29, 2017 07:34
GCSライフサイクル機能を使ってファイルを定期削除する ref: http://qiita.com/Sekky0905/items/65c60da94fe945a454fa
{
"lifecycle": {
"rule": [
{
"action": {
"type": "Delete"
},
"condition": {
"age": 365,
"isLive": true
@sekky0905
sekky0905 / file0.txt
Last active May 15, 2017 14:28
GoでBigQueryクライアントを実装してBigQueryからデータを取得する ref: http://qiita.com/Sekky0905/items/fd6ff9113d301aaa9e1d
go get cloud.google.com/go/bigquery
@sekky0905
sekky0905 / file0.go
Last active May 19, 2017 13:39
Go言語でSendGrid Web API v3を使って、メールを送信する ref: http://qiita.com/Sekky0905/items/7f7285d0a2b3e5f21e57
package main
import (
"encoding/json"
"fmt"
"github.com/joho/godotenv"
"github.com/sendgrid/sendgrid-go"
"log"
"os"
)
@sekky0905
sekky0905 / file0.go
Last active May 19, 2017 14:46
Go言語の便利なfmt.Sprintf ~任意の型と文字列をまとめて文字列(string型に)~ ref: http://qiita.com/Sekky0905/items/5a65602dce83551184b3
package main
import (
"fmt"
)
func main() {
type Person struct {
Age int
Height int
@sekky0905
sekky0905 / file0.txt
Created May 31, 2017 07:54
【自然言語処理】Google Natural Language API Client LibrariesをGoで実装してみる ref: http://qiita.com/Sekky0905/items/0a07ac74518b26816e04
go get -u cloud.google.com/go/language/apiv1
@sekky0905
sekky0905 / file0.go
Last active June 6, 2017 23:08
Go言語で今月から標準入力で受けたyyyy-mmまでの各月の月初と月末を一覧表示する簡単なコマンドラインアプリを作ってみた ref: http://qiita.com/Sekky0905/items/68fa4fa09d7176ac1878
package main
import (
"fmt"
"log"
"regexp"
"strconv"
"strings"
"time"
)
@sekky0905
sekky0905 / app.component.html
Last active June 9, 2017 05:36
Angular4(Angular2~)のユニットテスト【Angularのユニットテストの基本とComponentの簡単なテスト編】 ref: http://qiita.com/Sekky0905/items/13e71fce4f0a3cffbc09
<h1>
{{title}}
</h1>
<p class="button" (click)="changeH1Element()">ここをクリックして</p>
let numArray = [1, 2, 3];
let strArray = numArray.map((move) => {
switch (move) {
case 1:
return 'one';
case 2:
return 'two';
default:
return 'other';
}
@sekky0905
sekky0905 / file0.txt
Last active June 23, 2017 08:08
Javaでユーグリッドの互除法を実装してみた ref: http://qiita.com/Sekky0905/items/d7f68b3d37bd7cdab54f
a % b = r
b % r = s
r % s = 0