Skip to content

Instantly share code, notes, and snippets.

View yuizho's full-sized avatar

Yui Ito (伊藤結) yuizho

View GitHub Profile
public interface BrewingMethod {
public String brew();
}
@yuizho
yuizho / App.java
Last active February 6, 2016 06:27
Java thread practice
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class App {
private static final int COUNT = 10;
public static void main( String[] args ) throws InterruptedException {
// 10回カウントするCountDownLatchを生成
CountDownLatch countDownLatch = new CountDownLatch(COUNT);
// Threadを3つ生成するExecutorServiceを生成
@yuizho
yuizho / entory_robo.py
Last active February 16, 2016 16:11
連盟の入力欄に入力するよくん
# -*- coding: utf-8 -*-
import lxml.html as lh
import argparse
import datetime
from urllib import request
def CALC_OLD(birth_year):
today = datetime.date.today()
year = today.year
@yuizho
yuizho / checker.js
Last active March 5, 2016 17:29
chrome_plugin
(function() {
var click = function() {
alert("入れ替え後のイベント");
};
var load = function() {
// htmlの書き換え
var h1 = document.createElement('h3');
h1.setAttribute("class", "message");
h1.innerHTML = "checkerが有効です";
document.body.insertBefore(h1, document.body.firstChild);
public class Main {
public static final String URL = "jdbc:h2:tcp://localhost/~/demo_jdbc";
public static final String USER = "demo_user";
public static final String PASSWORD = "demo";
public static void main(String... args) {
Main main = new Main();
main.insert(10, "山田 たろう");
//...
}
@yuizho
yuizho / reactive.html
Created August 14, 2016 03:46
reactive.html
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.1.0/rx.lite.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(function(){
var inputStream = Rx.Observable.fromEvent($('#query'), 'keyup')
.pluck('target', 'value')
.throttle(300)
.filter(function(text) {return text.length > 0;})
@yuizho
yuizho / binding.html
Created August 14, 2016 06:08
binding.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script>
function ViewModel() {
this.email = observable();
@yuizho
yuizho / biding.puml
Created August 14, 2016 07:22
binding.puml
@startuml
participant load
participant event
participant viewModel
participant observer
participant bindViewModel
participant view
== Initialization ==
@yuizho
yuizho / index.html
Created August 14, 2016 11:52 — forked from anonymous/index.html
JS Bin // source https://jsbin.com/nepoja
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.1.0/rx.lite.js"></script>
<title>JS Bin</title>
</head>
<body>
@yuizho
yuizho / index.ios.js
Last active August 14, 2016 15:23
ReactNative TextInputのチュートリアル
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, {Component} from 'react';
import {
AppRegistry,
StyleSheet,