Skip to content

Instantly share code, notes, and snippets.

@kkismd
kkismd / Main.scala
Last active May 18, 2017 07:30
コンソールでつぶやくコマンド
import twitter4j._
object Main {
def main(args: Array[String]): Unit = {
val tweet = args.mkString(" ")
val status = TwitterFactory.getSingleton().updateStatus(tweet)
println("status id = " + status.getId.toString())
}
}
@kkismd
kkismd / google-ime_azik.tsv
Created November 20, 2017 01:43 — forked from junkw/google-ime_azik.tsv
Google 日本語入力用 AZIK ローマ字テーブル (for macOS + US キーボード)
-
~
:
;
a
ba
bd べん
be
bh ぶう
bi
@kkismd
kkismd / optional.rb
Created December 19, 2017 02:30
Optional class in Ruby
class Optional
private_class_method :new
class << self
def some(value)
new(value, false)
end
def none
new(nil, true)
@kkismd
kkismd / gi.sh
Created March 8, 2018 07:06
bash / zsh function `gi tlog` -> `git log`
# `git log` TYPO to `gi tlog`
function gi() {
a1=${1#t}
shift
git $a1 $*
}
@kkismd
kkismd / temperature.rb
Created May 11, 2018 08:05
steep example
class Temperature
# @implements Temperature
private_class_method :new
def self.celsius(num)
new(num)
end
def self.fahrenheit(num)
@kkismd
kkismd / dog.py
Created May 12, 2018 09:36
mypy why
class Dog():
def __init__(self, name: str) -> None:
self.name: str = name
def bark(self) -> str:
return "Bow-wow (" + self.name + ")"
def test():
# No mypy error, but causes Rutime error at next line!!!
dog = Dog(123)
@kkismd
kkismd / signature.rb
Created June 3, 2018 10:04
imitate sorbet typecheker
#! env ruby
class CodeSignature
def initialize(args)
@args = args
end
def returns(klass)
@ret = klass
puts "CodeSignature: @args = #{@args.inspect}"
puts "CodeSignature: @ret = #{@ret.inspect}"
package hello
import arrow.core.*
import arrow.typeclasses.*
import arrow.instances.*
import java.util.Collections.list
fun main(args: Array<String>) {
val a = ForOption extensions {
binding {
@kkismd
kkismd / shift_zero_to_underscore.json
Created July 10, 2018 11:15
Karabiner-ElementsでShift+ゼロをアンダースコアへ変換
{
"title": "Left-Shift + '0' to '_' ",
"rules": [
{
"description": "Left-Shift + '0' to '_' ",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "0",
using System;
using System.Collections;
using UnityEngine;
// TODO: UnityEngineへの依存を消したい
/// <summary>
/// コマンドのインターフェイス
/// TODO: インターフェイスいらないかもしれない?
/// </summary>