This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>メニューテキストメーカー</title> | |
<style> | |
@import url(https://fonts.googleapis.com/css?family=Lobster); | |
html, body, h2 { | |
padding: 0px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from readutil import * | |
inputData = readInput([ | |
InputData('name'), | |
InputData('age', 'age(number)?') | |
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Optional = (value) => { | |
var isNull = value === null || value === undefined; | |
return { | |
filter:(action) => (isNull || !action(value)) ? Optional() : Optional(value), | |
map:(action) => isNull ? Optional() : Optional(action(value)), | |
isPresent:() => !isNull, | |
ifPresent:(action) => { | |
if(!isNull) action(value); | |
}, | |
get:() => isNull ? null : value, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwitchCreator { | |
private final SwitchType switchType; | |
public SwitchCreator(SwitchType switchType) { | |
this.switchType = switchType; | |
} | |
public <T, R> R create( | |
T arg, | |
Predicate<T> leftFilter, Function<T, R> leftAction, | |
Predicate<T> rightFilter, Function<T, R> rightAction, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import urllib | |
import urllib2 | |
from datetime import datetime | |
# ------------------------- | |
# チャットワーク関連 | |
# ------------------------- | |
# チャットワークに送信する |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib | |
import urllib2 | |
from urllib2 import Request, urlopen, URLError, HTTPError | |
import sys | |
# http request | |
def request(url, getParams={}, proxy=False): | |
if proxy != False: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Either<L, R> { | |
default Optional<L> left() { return Optional.empty(); } | |
default Optional<R> right() { return Optional.empty(); } | |
static <L, R> Either<L, R> left(L left) { | |
Optional<L> leftValue = Optional.ofNullable(left); | |
if(!leftValue.isPresent()) throw new NullPointerException("left value is null"); | |
return new Either<L, R>() { | |
@Override | |
public Optional<L> left() { | |
return leftValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var app = require('app'); | |
var BrowserWindow = require('browser-window'); | |
require('crash-reporter').start(); | |
app.on('window-all-closed', function() { | |
if (process.platform != 'darwin') app.quit(); | |
}); | |
app.on('ready', function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var divList = document.querySelectorAll('div'); | |
var a = divList[0];// 1つ目の要素 | |
var b = divList[1];// 2つ目の要素 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var game = new Phaser.Game(400, 490, Phaser.AUTO, 'phaser-area'); | |
var player; | |
var coinGroup; | |
var cursors; | |
var playerSpeed = 3; | |
game.state.add('main', { | |
preload: function() { | |
game.stage.backgroundColor = '#ffffdd'; | |
game.load.image('player', '../../common/img/buta2.png'); | |
game.load.image('coin', '../../common/img/coin.png'); |