神谷翔一
東大情報科学科出身のエンジニア
主にbackendを書く事が多い
- MySQLの少し変わった使い方
- Finatra便利
| // Prints dependent packages (including test ones) of the given package. | |
| // $ deps github.com/foo/bar/baz | |
| // net | |
| // net/http | |
| // net/http/httptrace | |
| // net/http/httputil | |
| // net/http/internal | |
| // net/textproto | |
| // net/url | |
| // os |
| -- MySQL port of "Sharding & IDs at Instagram" | |
| -- http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram | |
| CREATE TABLE account_id_seq ( | |
| id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
| stub CHAR(1) NOT NULL, | |
| UNIQUE KEY stub (stub) | |
| ); | |
| INSERT INTO account_id_seq (stub) VALUES ('a'); |
| class CreateBookmarks < ActiveRecord::Migration | |
| def up | |
| execute <<-SQL | |
| CREATE SEQUENCE bookmarks_id_seq; | |
| CREATE FUNCTION next_bookmark_id(OUT result bigint) AS $$ | |
| DECLARE | |
| epoch bigint := 1420070400000; | |
| seq_id bigint; | |
| now bigint; |
| package com.trlln.bbb.stream | |
| import java.text.SimpleDateFormat | |
| import java.util.Date | |
| import com.amazonaws.auth.EnvironmentVariableCredentialsProvider | |
| import com.amazonaws.services.lambda.runtime.Context | |
| import com.amazonaws.services.lambda.runtime.events.KinesisEvent | |
| import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord | |
| import com.google.protobuf.InvalidProtocolBufferException |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "golang.org/x/text/encoding/japanese" |
| // Calculates Pi using Monte Carlo. See http://montepie.herokuapp.com/ | |
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| "math/rand" | |
| "time" | |
| ) |
| // This packages provides Rabin-Karp string search. | |
| package robin_karp | |
| const prime = 1456667 | |
| // Find tries to find string s in t and returns the index of the first index | |
| // of t where s found. Returns -1 when not found. It implements Rabin-Karp | |
| // algorithm. | |
| func Find(s, t string) int { | |
| ls := len(s) |
| source "https://rubygems.org" | |
| gem "rspec" |
| package main | |
| import ( | |
| "database/sql" | |
| "flag" | |
| "log" | |
| "os" | |
| "runtime/pprof" | |
| "time" |