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
# -*- 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
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
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
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
<!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
<!DOCTYPE html> | |
<audio id="audio" src="getwild.mp4" controls> | |
<script> | |
var isPlaying = false; | |
window.addEventListener('devicelight', function(event) { | |
console.log(event.value + 'lux'); | |
if(isPlaying) { | |
return; | |
} |
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
#!/bin/sh | |
cd `dirname $0` | |
PHANTOMJS_EXECUTABLE=node_modules/phantomjs/bin/phantomjs node_modules/casperjs/bin/casperjs index.js |
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
// カレンダーを表示する | |
(function() { | |
var url = 'http://google.com'; | |
var width = 1000; | |
var height = 400; | |
var casper = require('casper').create(); | |
casper.start(url); | |
casper.viewport(width, height); |
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
$ruby_file_list = `find -name "**.rb"`.split("\n") | |
def requiree(filename) | |
result_list = $ruby_file_list.select {|line| line.include?(filename)} | |
if result_list.length == 0 then | |
throw "file not found: #{filename}", 1 | |
end | |
require(result_list[0]) | |
end |