This file contains 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 python3 | |
"""This module is a sample of the OAuth2 authentication by Python3""" | |
__version__ = "0.1.0" | |
__author__ = "shin (shin.hateblo.jp)" | |
__copyright__ = "(C) 2012 shin" | |
__email__ = "[email protected]" | |
__license__ = "Apache License 2.0" | |
__status__ = "Prototype" |
This file contains 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
/** | |
* spigot.js | |
* version 1.1.0 | |
* (C) 2012 shin <s2pch.luck at gmail.com> | |
* Licensed under the Apache License 2.0 | |
* http://opensource.org/licenses/apache2.0 | |
* | |
* The Pi calculation is based on the spigot (streaming) algorithm[1]. | |
* This library depends on jsbn[2] (jsbn.js and jsbn2.js), | |
* one of BigInteger library written by pure JavaScript. |
This file contains 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 python3 | |
import sys | |
import http.server | |
port = 3000 if len(sys.argv) == 1 else int(sys.argv[1]) | |
httpd = http.server.HTTPServer( | |
('localhost', port), http.server.SimpleHTTPRequestHandler) | |
httpd.serve_forever() |
This file contains 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
// ## Snipet to setup user media by WebRTC (modified at 20121104) | |
// This code checked on GC(22), Opera(12), Fx(Nightly) in Mac OSX. | |
// In addition, only the FaceTime camera is tested. | |
// Compatibility table: http://caniuse.com/stream | |
var setupUserMedia = function(media, fn) { | |
if (arguments.length == 1) { | |
fn = media; | |
media = {video: true, audio: true}; | |
} | |
This file contains 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
# encoding: utf-8 | |
# 出来る限りロジックに集中できるようにモジュール化する | |
# 座標系はxが→、yが↑で、左下が(0, 0)で統一する。 | |
# (つまりフィールドでもパックでも同じ) | |
# 2次元配列はy, xの順とする(ex. field[y][x])。 | |
# 依存モジュール | |
require 'matrix' # 回転で使用 | |
require 'logger' # デバッグログ出力で使用 |
This file contains 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
require "webrick" | |
server = WEBrick::HTTPServer.new({ | |
DocumentRoot: "./", | |
Port: ARGV[0] ? ARGV[0].to_i : 8080, | |
MimeTypes: WEBrick::HTTPUtils::DefaultMimeTypes.merge({ | |
"js" => "application/javascript" | |
}) | |
}) | |
server.mount("/", WEBrick::HTTPServlet::FileHandler, Dir.pwd, {FancyIndexing: true}) |
This file contains 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 -*- | |
"""Tutrial: Detect square markers with OpenCV 2.4 in Python 2.7. | |
(C) 2013 Shintaro Seki | |
MIT License | |
The marker used in this program can be generated by the following script. | |
cv2.imwrite("marker.png", cv2.resize(np.array([ | |
[0, 0, 0, 0], |
This file contains 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
import numpy as np | |
def create_sphere(radius, slices, stacks): | |
"""Create a sphere geometry dynamically like glutSolidSphere(). | |
:param radius: Radius of sphere. | |
:param slices: A number of slices of longitude. | |
:param stacks: A number of stacks of latitude. | |
""" | |
radius = float(radius) |
This file contains 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
// jquery.swapimg | |
// (C) 2013 Shintaro Seki | |
// MIT License | |
$.fn.swapimg = function(option) { | |
var op = { | |
suffix: "_o", | |
preload: true, | |
swapped_file: null | |
}; | |
$.extend(true, op, option); |
OlderNewer