Skip to content

Instantly share code, notes, and snippets.

View mursts's full-sized avatar

Satoshi Miura mursts

View GitHub Profile
@mursts
mursts / create-gae-project
Created August 15, 2014 15:35
GAE/Pのプロジェクトテンプレートを作成する(webapp2)
#!/bin/sh
PROJECT_TEMPLATE_PATH=${HOME}/google-cloud-sdk/platform/google_appengine/new_project_template
if [ $# -eq 0 ]; then
CMD=`basename $0`
echo "usage: ${CMD} projectname"
exit 1
fi
@mursts
mursts / create-gae-project-flask.sh
Created August 26, 2014 21:34
create-gae-project-flask
#!/bin/sh
if [ $# -eq 0 ]; then
CMD=`basename $0`
echo "usage: ${CMD} projectname"
exit 1
fi
PROJECT_NAME=$1
@mursts
mursts / last_working_day_of_month.py
Last active August 29, 2015 14:07
土日を除いた月末を取得する
#!/usr/bin/env python
#coding: utf-8
import datetime
import workdays
from dateutil import relativedelta
def is_last_working_day_of_month(target_date):
first_day_of_next_month = target_date + relativedelta.relativedelta(months=1)
end_of_this_month = datetime.date(first_day_of_next_month.year,
@mursts
mursts / get_holidays.py
Created October 5, 2014 16:27
GoogleCalendarから祝日を取得する
#!/usr/bin/env python
# coding: utf-8
import datetime
import requests
URL = 'http://www.google.com/calendar/' \
'feeds/ja.japanese%23holiday@group.v.calendar.google.com/' \
'public/full'
@mursts
mursts / radiko.sh
Last active August 29, 2015 14:20 — forked from soramugi/radiko.sh
#!/bin/bash
# https://mtunn.wordpress.com/odroid-u2★セットアップ/radikoの録音・再生(archlinux)/
pid=$$
wkdir='/var/tmp'
playerurl=http://radiko.jp/player/swf/player_4.1.0.00.swf
playerfile="${wkdir}/player.swf"
keyfile="${wkdir}/authkey.png"
auth1_fms="${wkdir}/auth1_fms_${pid}"
auth2_fms="${wkdir}/auth2_fms_${pid}"
@mursts
mursts / naver_feed_parser.py
Created March 16, 2012 03:02
NAVERまとめのRSSをパースする
#!/usr/bin/env python
# -*- condign:utf-8 -*-
import requests
import feedparser
def main():
node_list = [
lambda x: ('title', x.title),
lambda x: ('link', x.link),
@mursts
mursts / base58.py
Created March 30, 2012 06:12
Flickrの短縮URLを作成
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import re
class Base58:
def __init__(self):
self._CHARS = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
self._CHAR_NUM = len(self._CHARS)
@mursts
mursts / gdrive_list.py
Created May 6, 2012 12:22
Google Driveのファイルを取得する
#!/usr/bin/envy python
# coding:utf-8
import sys
from getpass import getpass
import gdata.docs.client
APP_NAME = 'GoogleDocumentAPITest'
SERVICE_NAME = 'writely'
URI = 'https://docs.google.com/feeds/default/private/full/-/mine'
@mursts
mursts / sample_watchdog.py
Created October 24, 2012 16:26
watchdogを使ってホームディレクトリのファイルを監視するスクリプト
#!/usr/bin/env python
# coding:utf-8
import os
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class EventHandler(FileSystemEventHandler):
def on_created(self, event):
@mursts
mursts / dropbox_camera_arrangement.py
Created November 3, 2012 06:37
Dropboxの"Camera Uploads"にアップロードされた写真・動画ファイルを日付フォルダに振り分ける
#!/usr/bin/env python
# coding:utf-8
import os
import time
import re
import shutil
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler