例文を組み込んだAlfred Workflowを作りました: Alfred Git Commit Message Example
以下転載:
## {{{ http://code.activestate.com/recipes/577654/ (r1) | |
#!/usr/bin/env python | |
# Send DDE Execute command to running program | |
import time | |
from ctypes import POINTER, WINFUNCTYPE, c_char_p, c_void_p, c_int, c_ulong, c_char_p | |
from ctypes.wintypes import BOOL, DWORD, BYTE, INT, LPCWSTR, UINT, ULONG | |
# DECLARE_HANDLE(name) typedef void *name; | |
HCONV = c_void_p # = DECLARE_HANDLE(HCONV) | |
HDDEDATA = c_void_p # = DECLARE_HANDLE(HDDEDATA) |
from flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
@app.route('/index') | |
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350): | |
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,} | |
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}] | |
title = {"text": 'My Title'} |
"""ssh-copy-id for Windows. | |
Example usage: python ssh-copy-id.py ceilfors@my-remote-machine | |
This script is dependent on msysgit by default as it requires scp and ssh. | |
For convenience you can also try that comes http://bliker.github.io/cmder/. | |
""" | |
import argparse, os | |
from subprocess import call |
from dateutil import rrule | |
import datetime | |
# Generate ruleset for holiday observances on the NYSE | |
def NYSE_holidays(a=datetime.date.today(), b=datetime.date.today()+datetime.timedelta(days=365)): | |
rs = rrule.rruleset() | |
# Include all potential holiday observances | |
rs.rrule(rrule.rrule(rrule.YEARLY, dtstart=a, until=b, bymonth=12, bymonthday=31, byweekday=rrule.FR)) # New Years Day |
## Based on: http://code.activestate.com/recipes/577654/ | |
#!/usr/bin/env python | |
# Send DDE Execute command to running program | |
from ctypes import POINTER, WINFUNCTYPE, c_char_p, c_void_p, c_int, c_ulong, c_char_p | |
from ctypes.wintypes import BOOL, DWORD, BYTE, INT, LPCWSTR, UINT, ULONG | |
import time | |
# DECLARE_HANDLE(name) typedef void *name; | |
HCONV = c_void_p # = DECLARE_HANDLE(HCONV) |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
How to write python database driver | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
- https://pycon.jp/2016/ja/schedule/presentation/13/ | |
- https://www.youtube.com/watch?v=ax2WmQ_MSXs | |
- https://togetter.com/li/1028521 | |
======================================== | |
Preface |
以下転載:
# License: | |
# I hereby state this snippet is below "threshold of originality" where applicable (public domain). | |
# | |
# Otherwise, since initially posted on Stackoverflow, use as: | |
# CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl | |
# http://stackoverflow.com/a/31047259/2719194 | |
# http://stackoverflow.com/a/4858123/2719194 | |
import types |