Skip to content

Instantly share code, notes, and snippets.

View aiya000's full-sized avatar
🐶
Inu

aiya000 aiya000

🐶
Inu
View GitHub Profile
@aiya000
aiya000 / Observable.ts
Last active July 8, 2019 05:15
Typgin NativeScript's untyped Observable
import * as Untyped from 'tns-core-modules/data/observable'
import deprecated from 'deprecated-decorator' // npm install --save-dev deprecated-decorator
import { Field } from '@/data/conditional-types'
/**
* Don't dirty your hands.
* You must use this instead of [[Untyped.Observable]].
*
* This description is [here](http://aiya000.github.io/posts/2019-07-04-recover-nativescript-type-unsafe-observable.html).
*/
@Fmajor
Fmajor / vue.ctags
Created June 19, 2019 18:20
A ctags syntax file for vue components
# A ctags syntax file for vue components
--langdef=vue
--langmap=vue:.vue
# vue-commands in <template>
--regex-vue=/^(<template>)$/\1/t,template/{scope=set}{exclusive}
--regex-vue=/^\S*(.*(v-if=|v-for=|v-show=|ref=)("[^"]*"))/\2\3/c,vue-command/{scope=ref}
--regex-vue=/^(<\/template>)$/\1//{scope=pop}{exclusive}{placeholder}
# css in <template>
--regex-vue=/^(<style.*)$/style/s,script/{scope=set}{exclusive}
--regex-vue=/^(<\/style>)$/\1//{scope=clear}{placeholder}
@aiya000
aiya000 / BasicDataExpandableListAdapter.kt
Last active February 18, 2019 05:58
Make an adapter easily than SimpleExpandableListAdapter
/**
* SimpleExpandableListAdapterのコンストラクタが受け取る引数が
* 何を言っているのか全然わからないので、
* 自然な形のやつ。
*
* @param Child CShowによって表示可能な子
* @param clever リストアップされる親と子の木
* @param CShow 子を表示する方法
*/
class BasicDataExpandableListAdapter<Child>(
#!/bin/env stack
{-
stack --resolver=lts-12.24 script --package extensible
-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE GADTs #-}
@d-kuro
d-kuro / git_conflict.md
Created October 18, 2018 12:21
コンフリクトしたときの --theirs と --ours

コンフリクトしたときの --theirs と --ours

よく忘れるやつ

merge

$ git checkout branch_b
$ git merge branch_a
@HirotoShioi
HirotoShioi / Trie.hs
Created September 15, 2018 03:17
Trie tree arbitrary instance
-- |A @'Trie' a b@ is a map with keys of type @[a]@ and values of type @b@.
data Trie a b = Fork (Maybe b) (Map a (Trie a b))
deriving (Show, Eq)
instance (Ord a, Arbitrary a, Arbitrary b) => Arbitrary (Trie a b) where
arbitrary :: Gen (Trie a b)
arbitrary = sized $ \n -> if n == 0 -- We interpret the size n as maximum number of values
-- stored in the trie.
then return empty -- If the n == 0, the trie must be empty.
@NomadBlacky
NomadBlacky / foo.scala
Last active August 13, 2018 06:08
scala.reflect.ClassTag
@ def foo[T: scala.reflect.ClassTag](obj: Any): Unit = obj match {
case t: T => println(t.getClass.getName)
case _ => println("ng")
}
defined function foo
@ foo[Int](1)
java.lang.Integer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ababup1192
ababup1192 / elm-hello-world.md
Last active June 29, 2020 08:31
Elmの開発環境を整えて、HelloWorldをするまで

ElmのHello Worldができるまで (2018 10/25)

nodeのインストール

  • 可能であれば、nvm, nodebrew等を使ってnodeをインストールする。

以下が、現時点(2018/9/3)の安定版のバージョン。

$ node -v
@Iruyan-Zak
Iruyan-Zak / index.html
Created May 17, 2018 05:08
New gender selection form
<head>
<title>Spin radio button</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="forms-area">
<h3>性別</h3>
<div class="classic-area">
<div class="" ><input type="radio" name="classic-gender" value="1"> 男性</div>
<div class="" ><input type="radio" name="classic-gender" value="2"> 女性</div>