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
Option Explicit | |
Dim wkFile, wkPrompt As String | |
Dim wkFileName As Variant | |
Dim strFileName As String | |
Dim objStream As Object | |
Dim objRegExp As Object | |
Dim ii As Long |
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 -*- | |
from datetime import datetime | |
def timesince(dt, default=u"記事が投稿されました"): | |
""" | |
timesince filter | |
http://flask.pocoo.org/snippets/33/ | |
を日本語ローカライズしflashに対応させたもの | |
""" |
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
from functools import wraps | |
from flask import request, Response | |
from setting import USERNAME, PASSWORD | |
def check_auth(username, password): | |
"""This function is called to check if a username / | |
password combination is valid. | |
""" | |
return username == USERNAME and password == PASSWORD |
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
# Notifier example from tutorial | |
# | |
# See: http://github.com/seb-m/pyinotify/wiki/Tutorial | |
# | |
import pyinotify | |
wm = pyinotify.WatchManager() # Watch Manager | |
mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE # watched events | |
class EventHandler(pyinotify.ProcessEvent): |
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 python | |
# -*- coding: utf-8 -*- | |
from tweepy import API, OAuthHandler | |
from pit import Pit | |
def main(post): | |
"""Function for OAuth Setting and Tweet""" | |
cconf = Pit.get('oauth_conf') | |
auth = OAuthHandler(cconf['consumer_key'], cconf['consumer_secret']) |
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 -*- | |
import re, pprint | |
def pp(obj): | |
""" | |
PrettyPrint for Python list and Dict | |
Usage | |
>>> data = {u"spam" : u"スパム", u"ham" : u"ハム", u"eggs" : u"エッグス"} | |
>>> print pp(data) |
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 -*- | |
""" | |
This Script base on https://github.com/nathforge/pyotp | |
and http://yamatamemo.blogspot.jp/2011/06/oath-3.html | |
and http://stackoverflow.com/questions/8529265/ \ | |
google-authenticator-implementation-in-python | |
サンプルで記載しているsecretはHexspeakの一種と認識 | |
Dartでも使っていた |
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 -*- | |
import sys | |
from email.utils import parsedate_tz, mktime_tz | |
from datetime import datetime | |
def conv_2822_to_8601(s): | |
time_tuple = parsedate_tz(s) | |
time_stamp = mktime_tz(time_tuple) | |
return datetime.fromtimestamp(time_stamp) |
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 | |
# -*- coding: utf-8 -*- | |
import sys | |
from twython import Twython, TwythonError | |
from pit import Pit | |
def main(post): | |
"""Function for OAuth Setting and Tweet""" | |
oauth_conf = Pit.get('oauth_conf') |
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 | |
# -*- coding: utf-8 -*- | |
from time import time | |
from threading import Thread | |
""" | |
http://gihyo.jp/dev/serial/01/pythonhacks/0005 | |
Python3 threading モジュールを使ったサンプル | |
""" |
OlderNewer