This file contains hidden or 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
for i in {10..21}; do echo -n "9月${i}日"; curl -s "http://weather.goo.ne.jp/past/day_search.html?areacode=670&p_month=9&p_day=$i" | grep 'alt="雨"'| wc -l; done | sort -k 2 |
This file contains hidden or 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 perl | |
use strict; | |
use warnings; | |
use Net::Twitter::Lite; | |
use WWW::Mechanize; | |
use utf8; | |
binmode STDIN, ":utf8"; | |
binmode STDOUT, ":utf8"; |
This file contains hidden or 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 perl | |
# | |
# Last modified: Fri, 28 Dec 2012 15:37:46 +0900 | |
# | |
# Usage: perl diff.pl foo.c func1 func2 | |
# will compare func1() and func2() in foo.c | |
# | |
# Note: The function must finish with "}" at the beggining of line, like: | |
# int func(int a) { | |
# ... |
This file contains hidden or 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
(( ynum = (`date +"%Y"` - 2000) * 2)); for i in {08..20}; do echo -n "9月${i}日"; curl -s "http://weather.goo.ne.jp/past/day_search.html?areacode=670&p_month=9&p_day=$i" | egrep 'weather_.\.gif' | head -$ynum | grep 'alt="雨"'| wc -l; done | sort -k 2 |
This file contains hidden or 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
#!/bin/zsh | |
# | |
# mpo2gif: Convert MPO file to animation GIF file. | |
# | |
# Author: Akira Funahashi <[email protected]> | |
# Requirement: exiftool (sudo port install p5-image-exiftool) | |
# ImageMagick (sudo port install ImageMagick) | |
# Usage: ./mpo2gif.sh file.mpo [output.gif] | |
# | |
# Reference: |
This file contains hidden or 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 datetime | |
today = datetime.date.today() | |
friday = today + datetime.timedelta( (4-today.weekday()) % 7) | |
for i in range(20): | |
s = friday.strftime(u'%Y年X%m月X%d日'.encode('utf-8')).decode('utf-8').replace('X0','X').replace('X','') | |
print s | |
friday = friday + datetime.timedelta(7) |
This file contains hidden or 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
spatial2gif() { | |
# Create animated gif files from simulation results generated by [SpatialSimulator](https://github.com/funasoul/docker-spatialsim) | |
local width="400" | |
local opt_resize="${width}" | |
# -h, --help options | |
if [[ "$1" = "-h" || "$1" = "-help" || "$1" = "--help" || "$1" = "--h" ]]; then | |
echo "Usage: $0 [width] [height]" | |
echo " Create animated GIF files from simulation results generated by" | |
echo " SpatialSimulator." | |
echo " - [width] ... width of animated GIF file (default: $width)" |
This file contains hidden or 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 | |
# vim: set fileencoding=utf-8 : | |
# -*- coding: utf-8 -*- | |
# | |
# Last modified: Tue, 09 Jan 2018 20:03:12 +0900 | |
from dateutil import rrule | |
from datetime import datetime, time, timedelta | |
import locale |
This file contains hidden or 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
get_nendo() { | |
foreach i ({0..11}) [ ~ ] | |
local lmonth=`date -v-${i}m '+%m'` | |
if [ $lmonth = "04" ]; then | |
local nendo=`date -v-${i}m '+%Y'` | |
fi | |
end | |
echo "$nendo" | |
} |
This file contains hidden or 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
is_dropbox_running() { | |
# Return 0 if dropbox is running. | |
# Thanks to Official Dropbox Command Line Interface. | |
# https://www.dropboxwiki.com/tips-and-tricks/using-the-official-dropbox-command-line-interface-cli | |
if [[ -r ~/.dropbox/dropbox.pid ]]; then | |
pid=$(cat ~/.dropbox/dropbox.pid) | |
else | |
return 1 | |
fi | |
if [[ "$OSTYPE" == "linux-gnu" ]]; then |
OlderNewer