Skip to content

Instantly share code, notes, and snippets.

View foo.sql
update bar set text = 'aaa', text2 = 'bbb' where id = 2043;
update bar set (text, text2) = ('aaa', 'bbb') where id = 2043;
update bar set text1 = 'aaa', text2 = 'bbb' where id = 2043;
update bar set (text1, text2) = ('aaa', 'bbb') where id = 2043;
View place for contributor
private val place = XmlPatterns.psiElement(XmlToken::class.java)
.withText(DUMMY_IDENTIFIER_TRIMMED)
.withParent(XmlPatterns.xmlText()
.withParent(XmlPatterns.psiElement(XmlTag::class.java)
.withName(RESOURCES_TAG_NAME)
)
)
View keybase.md

Keybase proof

I hereby claim:

  • I am shiraji on github.
  • I am shiraji (https://keybase.io/shiraji) on keybase.
  • I have a public key ASD4HKt981CfrQZ0X25kUZNZwE2gEE3zPCWX1gXSvaYVwwo

To claim this, I am signing this object:

View nestedLet.kt
@Throws(Exception::class)
fun hour10minute10_answer115degree2() {
"10:10".let { time ->
GetClockHandsDegree(DegreeCalcService()).execute(time).let {
println("(degree-min (clock-degree (clock-str \"$time\")) -> ${it.value} == 115")
Assert.that(it.value == 115,
"$time actual:${it.value} expected:" + 115)
}
}
@shiraji
shiraji / jdk_setting
Last active Aug 26, 2018
JDK export settings for Kontribution
View jdk_setting
export JAVA_HOME=`/usr/libexec/java_home -v "1.8"`
export JDK_16=`/usr/libexec/java_home -v "1.6"`
export JDK_17=`/usr/libexec/java_home -v "1.7"`
export JDK_18=`/usr/libexec/java_home -v "1.8"`
export JDK_9=`/usr/libexec/java_home -v "10"`
View classDelegationUsingObject.kt
interface I {
fun foo()
}
object O : I {
override fun foo() {
println("Foo!!!")
}
}
@shiraji
shiraji / EnumAdapter.kt
Created Jan 19, 2017
Android-Orma EnumAdapter
View EnumAdapter.kt
@StaticTypeAdapter(targetType = Enum::class, serializedType = String::class)
class EnumAdapter {
companion object {
@JvmStatic
fun <T : Enum<T>> serialize(source: T): String {
return source.name
}
@JvmStatic
View README.md

Kotlinで気持ちいい!と思ったけど、落選した項目

View gist:ce20ede803d6e3e850026efa1438e76f
@Fancy(annotation = FooAnno())
fun foo() {
@Fancy(annotation = @FooAnno())
foo()
@Fancy2(annotation = arrayOf(FooAnno()))
foo()
View Intellij plugin test info
http://www.jetbrains.org/intellij/sdk/docs/basics/testing_plugins.html
http://www.jetbrains.org/intellij/sdk/docs/basics/testing_plugins/tests_and_fixtures.html
* LightPlatformCodeInsightFixtureTestCase
* IdeaTestFixtureFactory
PlatformTestUtil