Skip to content

Instantly share code, notes, and snippets.

@kzyplus
kzyplus / mail_check.php
Created June 1, 2017 12:23
社内勉強会用のサンプルプログラムです
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// --------------------------------------------
// 対象日時チェック(コマンドライン引数かURLパラメータか)
$target_date = $_REQUEST['$target_date'] ? $_REQUEST['$target_date'] : ($argv[1] ? $argv[1] : date('Ymd'));
$year = substr($target_date,0,4);
$month = substr($target_date,4,2);
$day = substr($target_date,6,2);
if (false === checkdate($month,$day,$year)){
@kzyplus
kzyplus / crlf_convert.sh
Last active February 7, 2017 09:55
指定したディレクトリ以下をCRLFに変換
#/bin/sh
ext_list=("*.pl" "*.htm" "*.html" "*.db")
if [ $# -ne 1 ]; then
echo "対象のpathを指定してください" 1>&2
exit 1
else
if [ -e $1 ]; then
for idx in "${ext_list[@]}"