Skip to content

Instantly share code, notes, and snippets.

View moqada's full-sized avatar

Masahiko Okada moqada

View GitHub Profile
# -*- coding: utf-8 -*-
import argparse
import datetime
def main(start, end):
start = datetime.datetime.strptime(start, '%Y%m%d')
end = datetime.datetime.strptime(end, '%Y%m%d')
current = start
while current <= end:
# -*- coding: utf-8 -*-
import argparse
import collections
import json
def get_name(ins):
for t in ins['Tags']:
if t['Key'] == 'Name':
return t['Value']
@moqada
moqada / graph.py
Created December 19, 2014 05:50
pygal sample on flask
# -*- coding: utf-8 -*-
import pygal
from flask import Flask, Response
app = Flask(__name__)
@app.route('/')
def index():
@moqada
moqada / hello.py
Last active August 29, 2015 14:10
# -*- coding: utf-8 -*-
from linesman.middleware import make_linesman_middleware
from flask import Flask
app = Flask(__name__)
@app.route('/hello')
def hello():
http://livedoor.blogimg.jp/nwknews/imgs/b/5/b5ef5155-s.jpg
http://livedoor.blogimg.jp/nwknews/imgs/a/0/a054fbf9.jpg
http://livedoor.blogimg.jp/nwknews/imgs/a/9/a9814f4e-s.jpg
http://livedoor.blogimg.jp/nwknews/imgs/1/7/175abacd.jpg
http://livedoor.blogimg.jp/nwknews/imgs/6/1/612dc386-s.jpg
http://livedoor.blogimg.jp/nwknews/imgs/5/a/5a468fce.jpg
http://livedoor.blogimg.jp/nwknews/imgs/5/5/55902e8c.jpg
http://livedoor.blogimg.jp/nwknews/imgs/d/0/d088f41e.png
http://livedoor.blogimg.jp/nwknews/imgs/9/2/92b6b2e5.jpg
http://livedoor.blogimg.jp/nwknews/imgs/e/5/e50a6c31.jpg
@moqada
moqada / trello.js
Last active August 29, 2015 14:04
[Bookmarklet] Add batch action for updating due per List
(function(authToken){
var containerClsName = 'batch_due_action_container';
var initialize = function() {
$('.' + containerClsName).remove();
$('.list').each(function(){
var $list = $(this);
var $form = $('<form class="' + containerClsName + '">')
.appendTo($list.find('.list-header'));
@moqada
moqada / index.html
Created June 30, 2014 07:08
PhoneGap(Cordova) で Sentry を使う ref: http://qiita.com/moqada/items/824241db74cd81f0daed
<script src="//cdn.ravenjs.com/1.1.15/jquery,native/raven.min.js"></script>
<script>
Raven.config('https://<key>@app.getsentry.com/<id>').install();
</script>
@moqada
moqada / file2.txt
Created June 26, 2014 04:46
CoffeeScript で AngularJS のテストを書くときに気をつけること ref: http://qiita.com/moqada/items/ebc052415020f178ee76
Error: [ng:areq] Argument 'fn' is not a function, got $HttpProvider
http://errors.angularjs.org/1.3.0-beta.7/ng/areq?p0=fn&p1=not%20a%20function%2C%20got%20%24HttpProvider
@moqada
moqada / file0.txt
Created June 24, 2014 01:59
serverspec で Elastic Beanstalk をテストする ref: http://qiita.com/moqada/items/c62b5852c7654bb972c8
source 'https://rubygems.org'
gem 'serverspec'
gem 'rake'
@moqada
moqada / fabfile.py
Last active August 29, 2015 14:02
Elastic Beanstalk 内の EC2 インスタンス一覧を生成する fabfile
# -*- coding: utf-8 -*-
import json
import boto
import boto.beanstalk
import boto.ec2
from fabric.api import task, puts
# Elastic Beanstalk の Applicaton 名
EB_APP_NAME = 'example-app'
# Elastic Beanstalk の リージョン名