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
# print weeknum, monday-sunday str | |
# like: 19w36(190902-190908) | |
import datetime | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--scrapbox' ,action='store_true') #for scrapbox text | |
parser.add_argument('--name') #for scrapbox text | |
args = parser.parse_args() |
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
import re | |
import select | |
import sys | |
def isPipe(): | |
if select.select([sys.stdin,],[],[],0.0)[0]: | |
return True | |
return False | |
def get_source(): |
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 xml.etree import ElementTree | |
import mojimoji | |
import jaconv | |
f = 'mysetting_azik.nrset' | |
tree = ElementTree.parse(f) | |
root=tree.getroot() | |
roman_dict = {} | |
prev_key = '' | |
# plist > dict > key string |
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
import json | |
import glob | |
import os | |
import re,datetime | |
import dateutil.parser | |
SRCDIR = 'src' | |
OUTDIR = 'out' | |
def get_dispinfo(dat): |
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
chunk = """ | |
quick | |
brown | |
foxes | |
jumped | |
over | |
the lazy dog |
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 -*- | |
# hierarchical lines | |
class HierLines: | |
def __init__(self): | |
self.current_rank = 0 | |
self.data = [] | |
self.current_cursor = self.data | |
self.cursor_stack = [] | |
self.cursor_stack.append(self.current_cursor) |
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 -*- | |
# hierarchical lines | |
class HierLines: | |
def __init__(self): | |
self.current_rank = 0 | |
self.data = [] | |
self.current_cursor = self.data | |
self.cursor_stack = [] | |
self.cursor_stack.append(self.current_cursor) |
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 -*- | |
# stack sample | |
textdata = [ | |
{'d':0, 't':'c1'}, | |
{'d':1, 't':'c1-1'}, | |
{'d':1, 't':'c1-2'}, | |
{'d':2, 't':'c1-2-1'}, | |
{'d':0, 't':'c2'}, | |
{'d':1, 't':'c2-1'}, |
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
# markdown headline | |
import sys | |
import re | |
import pprint | |
''' | |
ベタ/tab-outline/markdownの変換 | |
元が何か判別 | |
変換先は何か | |
コマンドラインオプション |
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
# シェルスクリプト関数として .bashrc などに書いてもよい | |
function gist-here () { | |
if [ $# -ne 1 ]; then | |
echo 'gist_here [FILENAME]' | |
echo ' to post the file, clip its URL.' | |
exit 1 | |
fi | |
url=`gist $1` | |
echo '#!/bin/bash' > gist-update.sh | |
echo "gist -u $url $1" >> gist-update.sh |
NewerOlder