Skip to content

Instantly share code, notes, and snippets.

View kobakei's full-sized avatar

Keisuke Kobayashi kobakei

View GitHub Profile
{
"timeline": {
"id": 1,
"description": "This is sample ad",
"image": {
"large": "https://dummyimage.com/600x200/00f/fff"
}
}
}
@kobakei
kobakei / tuple.kt
Last active March 17, 2018 12:54
Tuple in Kotlin
import java.io.Serializable
public data class Tuple4<out A, out B, out C, out D>(
public val first: A,
public val second: B,
public val third: C,
public val fourth: D
) : Serializable {
public override fun toString(): String = "($first, $second, $third, $fourth)"
@kobakei
kobakei / MainActivity.java
Created January 13, 2013 19:22
Android:YouTubeの動画URLを取得してMediaPlayerで再生するサンプル
/**
* This code is originally from here:
* http://stackoverflow.com/questions/7203047/code-for-download-video-from-youtube-on-java-android
*
* And some code about HTTP header is from here:
* http://xissy.github.com/dev/2012/09/28/get-a-youtube-mp4-file-link-which-can-be-played-iphone/
*/
package com.example.zzz;
import java.io.IOException;
@kobakei
kobakei / index.html
Created January 5, 2012 05:57
文字列を虹色に表示するスクリプト
<!DOCTYPE html>
<html>
<head>
<title>Rainbow</title>
<!-- jQuery -->
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery", "1");
</script>
<!-- rainbow.js -->
@kobakei
kobakei / .vimrc
Created November 14, 2011 15:43
Windows gVim設定ファイル(_vimrc)
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"