Skip to content

Instantly share code, notes, and snippets.

View yuizho's full-sized avatar

Yui Ito (伊藤結) yuizho

View GitHub Profile
@yuizho
yuizho / .gitignore
Created February 8, 2020 13:33
my Kotlin project's configs
# Maven
target/
!.mvn/wrapper/maven-wrapper.jar
# IntelliJ
.idea
*.iws
*.iml
*.ipr
Stream<String> stream =
Arrays.asList("a", "b", "c").stream()
.filter(s -> !s.equals("a"));
System.out.println(stream.collect(Collectors.toList()))
// ココでエラーになる
// java.lang.IllegalStateException: stream has already been operated upon or closed
System.out.println(stream.collect(Collectors.toList()));
// ------------- 入力受ける系
// 数値
val N = readLine()?.toInt() ?: 0
// スペース区切り
val steps = readLine()!!.split(" ").map(String::toInt)
// 連続受け取り kotlin 1.3〜
val inputs = List(N) { readLine()!!.split(" ").map(String::toInt) }
// 連続受け取り kotlin ~1.0
val list: ArrayList<List<Int>> = arrayListOf()
for (n in 0 until N) {
class StreamPlactice {
public static void main(String[] args) {
List<Bean> list = Arrays.asList(
new Bean(1, "a"),
new Bean(2, "b"),
new Bean(3, "c"),
new Bean(1, "aa"),
new Bean(1, "aaa"),
new Bean(2, "bb")
);
@yuizho
yuizho / emacs_keybind_memo.md
Last active May 26, 2019 23:32
shortcut, keybind memo
  • Delete Line
    • Ctrl + a and Ctrl + k
    • Ctrl + s + BackSpace
docker run \
-e MYSQL_ROOT_PASSWORD=password \
-e MYSQL_USER=test \
-e MYSQL_PASSWORD=password \
-e MYSQL_DATABASE=test \
-e TZ=Asia/Tokyo \
-p 3306:3306 \
--name mysql_db \
-d mysql:5.7
@yuizho
yuizho / input-date.html
Last active April 4, 2019 23:35
input-date snippet
<input id="date-form" type="date" min="2019-04-01" max="2030-03-31">
<script>
(function() {
var dateForm = document.querySelector('#date-form');
var today = new Date();
var month = ('0' + (today.getMonth() + 1)).slice(-2);
var day = ('0' + today.getDate()).slice(-2);
// set today as default value
dateForm.value = `${today.getFullYear()}-${month}-${day}`
}())
@yuizho
yuizho / index.html
Created March 29, 2019 15:55
JS Bin [vue js training template] // source https://jsbin.com/rageyap
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[vue js training template]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.v-enter-active, .v-leave-active {
transition: opacity 1s;
-- String
-- convert int into String
String.fromInt 1
-- "1" : String
-- create String from List
String.join "," ["a", "b", "c"]
-- "a,b,c" : String
## -------------- syntax
l = ['a', 'b']
l[0], l[1] = l[1], l[0]
print(l)
# ['b', 'a']
0 <= 1 <=1
# True
0 <= 4 <=3
# False