Skip to content

Instantly share code, notes, and snippets.

@yyYank
yyYank / settings.json
Last active April 27, 2021 03:56
settings.jsonがほぼVSCodeVimの設定になった
{
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.highlightedyank.enable" :true,
"vim.highlightedyank.color": "rgba(241, 238, 29, 0.5)",
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "v", "s", "p"],
@yyYank
yyYank / keyboards_helix_rev2_keypmaps_default_keymap.c
Created September 3, 2019 05:15
qmkのhelixのdefaultのkeymapをいじったもの
#include QMK_KEYBOARD_H
#include "bootloader.h"
#ifdef PROTOCOL_LUFA
#include "lufa.h"
#include "split_util.h"
#endif
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
#ifdef SSD1306OLED
@yyYank
yyYank / keyboards_ergo42_keypmaps_biacco-underglow-mod_keymap.c
Created September 3, 2019 05:05
ergo42のbiacco-underglowのqmk設定をいじったもの
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
#define _BASE 0
#define _META 1
#define _SYMB 2
#define _RAISE 3
#define _RGB 4
@yyYank
yyYank / AssertJsonk.kt
Last active March 24, 2019 01:56
こんな感じでしょうか?apply使ってるのがちょっと残念、あとインスタンスめっちゃ生成されたり
import com.jayway.jsonassert.JsonAssert
import com.jayway.jsonassert.JsonAsserter
import org.hamcrest.Matcher
import kotlin.test.*
class LibraryTest {
@Test fun testHogeJson() {
val jsonString = """
{
"foo": "aaa",
fun main(args: Array<String>) {
val f : (() -> Unit)? = null
f() // コンパイル通る
}
operator fun <R> Function0<R>?.invoke() = this?.invoke()
operator fun <P1,R> Function1<P1,R>?.invoke() : R? = this?.invoke()
operator fun <P1, P2, R> Function2<P1, P2, R>?.invoke() : R? = this?.invoke()
operator fun <P1, P2, P3, R> Function3<P1, P2, P3, R>?.invoke() : R? = this?.invoke()
operator fun <P1, P2, P3, P4, R> Function4<P1, P2, P3, P4, R>?.invoke() : R? = this?.invoke()
@yyYank
yyYank / nemui.kt
Created November 22, 2016 11:23
この書き方知らなかった
fun highOrderOne(one : Int, f : ((one : Int) -> Int)) {
}
fun hoge(){
highOrderOne(1) { x ->
x + 1
}
}
@yyYank
yyYank / なぞ.kt
Last active October 28, 2016 18:26
fun hoge() {
val callback = {} いくぜ {}
}
infix fun (() -> Unit).いくぜ(f: () -> Unit) : Runnable = Runnable {f()}
class A() {
private val str: String
init {
str = "aaa"
val s: String = getStr()
println("${s.length}") // java.lang.NullPointerException
}
fun getStr(): String {
return str