Skip to content

Instantly share code, notes, and snippets.

bind status D !rm %(file)
@broccoli1002
broccoli1002 / clodure.go
Last active June 23, 2018 06:00
スターティングGO言語: クロージャーとしての関数 p105
package main
import (
"fmt"
)
func later() func(string) string {
// 1つ前に与えられた文字列を保存する変数
var store string
// 引数に文字列をとり文字列を返す関数を返す
@broccoli1002
broccoli1002 / slice_address.go
Last active June 23, 2018 06:40
スターティングGO言語: スライス拡張 p175
package main
import (
"fmt"
)
func main() {
/* A */
a := [3]int{1, 2, 3} // s == [1,2,3]
s := a[:]
@broccoli1002
broccoli1002 / channel.go
Last active June 23, 2018 07:33
スターティングGO言語: チャネルについて p184
package main
import (
"fmt"
)
func main() {
var (
ch0 chan int
@broccoli1002
broccoli1002 / channel_send_and_recieve.go
Created June 23, 2018 08:05
スターティングGO言語:送受信について p188
package main
import (
"fmt"
)
func receiver(ch <-chan int) {
for {
i := <-ch
fmt.Println(i)
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
)
@broccoli1002
broccoli1002 / autoinvoke.py
Last active October 31, 2019 09:11
lambda自動実行
# usage: python3 hoge.py us-east-1 20190926
import boto3
import datetime
import json
import sys
REGION = sys.argv[1]
YYYYMMDD_UTC = datetime.datetime.strptime(sys.argv[2], '%Y%m%d')
# About the Problem
<!-- you write concisely about Problem, Background etc. -->
# How do you resolve this problem?
<!-- you write concisely about way of solving. -->
# Include migration?
<!-- If MR includes migration, you must tag migration to this MR. -->
# About an operation confirmation
#include <SPI.h>
#include <MFRC522.h>
#include "LedControl.h"
#define CARDUID "c3 85 14 21"
#define TAGUID "33 6a 38 1f"
constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above
constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above