Skip to content

Instantly share code, notes, and snippets.

View utahta's full-sized avatar

Yuta UEKUSA utahta

  • Merpay, Inc.
  • Tokyo, Japan
View GitHub Profile
@utahta
utahta / a.cpp
Created January 12, 2021 08:52
階乗の桁数と末尾0の個数
#include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;
int main() {
ll n;
cin >> n;
@utahta
utahta / d.md
Last active July 28, 2019 02:20
abc135

割り算の余りの性質
合同

≡は合同を表す記号
a ≡ b (mod m)は、aをmで割った余りとbをmで割った余りが等しいことを表す

(mod m)
a ≡ b, c ≡ d
のとき、以下成り立つ

@utahta
utahta / jwt_parse.go
Created April 12, 2018 10:34
Cloud IAP経由で渡されたJWTのパースを試みる
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"github.com/dgrijalva/jwt-go"
@utahta
utahta / foobar.json
Last active April 11, 2018 10:44
json to environment variables using jq.
{
"aaa": "one",
"bbb": "two",
"ccc": "three"
}
@utahta
utahta / panic_defer_behavior.go
Created December 2, 2017 21:35
panic defer behavior in go
package main
import (
"fmt"
"time"
)
func doPanic() {
defer fmt.Println("--- print ---")
panic("ʕ◔ϖ◔ʔ")
@utahta
utahta / stream.go
Last active June 5, 2017 13:58
ioutil.ReadAll and base64.Encoder benchmark
package bench
import (
"bytes"
"encoding/base64"
"io"
"io/ioutil"
)
func read1(body io.Reader) []byte {
@utahta
utahta / memo-tmux-2.4.md
Last active May 17, 2017 06:06
patches for tmux 2.4
@utahta
utahta / echo_logger_bench_test.go
Created February 3, 2017 12:25
Benchmark test echo logger in the same way as uber-bo/zap.
package log_test
import (
"io/ioutil"
"testing"
"github.com/labstack/gommon/log"
)
func withBenchedLogger(b *testing.B, f func(*log.Logger)) {
@utahta
utahta / video_tweet.go
Created October 16, 2016 09:59
video tweet with anaconda
package main
import (
"encoding/base64"
"io/ioutil"
"log"
"net/url"
"github.com/ChimeraCoder/anaconda"
)