Skip to content

Instantly share code, notes, and snippets.

setunai setunai

Block or report user

Report or block setunai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@setunai
setunai / gist:1933078
Created Feb 28, 2012
Flaskのログインデコレータ
View gist:1933078
# http://blog.setunai.net/20120227/flask%e3%81%ae%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e3%83%87%e3%82%b3%e3%83%ac%e3%83%bc%e3%82%bf/
from functools import wraps
from flask import Flask
app = Flask(__name__)
def login_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):
@setunai
setunai / gist:1933054
Created Feb 28, 2012
クロスドメインへのアクセスが回避できるXMLHttpRequest2
View gist:1933054
<html>
<head>
<title>XHR2/jquery test</title>
</head>
<body>
<input type="text" id="zip" style="width:100px;" value="2210824">
<input type="button" id="run" value="test">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
// http://blog.setunai.net/20120229/%e3%82%af%e3%83%ad%e3%82%b9%e3%83%89%e3%83%a1%e3%82%a4%e3%83%b3%e3%81%b8%e3%81%ae%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%8c%e5%9b%9e%e9%81%bf%e3%81%a7%e3%81%8d%e3%82%8bxmlhttprequest2/
@setunai
setunai / gist:1912532
Created Feb 26, 2012
jQueryでクロスドメインのjson取得(JSONP)
View gist:1912532
<html>
<head>
<title>jsonp/jquery test</title>
</head>
<body>
<input type="text" id="url" style="width:300px;" value="http://blog.setunai.net/">
<input type="button" id="run" value="test">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
(function ($) {
You can’t perform that action at this time.