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
#!/bin/sh | |
file=$1 | |
if [ -f $file ]; then | |
exit | |
fi | |
cr_count=$( grep -c $'\r$' $file ) | |
lf_count=$( grep -c $'\n$' $file ) |
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
\set PROMPT1 '%[%033[1m%]%M %n@%/ %`date`\n%R%x%#%[%033[0m%] ' | |
\set PROMPT2 '%R%x%# ' | |
\pset border 1 | |
\pset format wrapped | |
\pset linestyle unicode | |
\pset null <NULL> | |
\x auto | |
\set COMP_KEYWORD_CASE upper |
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 perl | |
use warnings; | |
use strict; | |
use feature 'say'; | |
use Cwd; | |
my $dir = shift || Cwd::getcwd(); | |
say $dir; |
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 perl | |
# | |
# split data file as evenly as possible for n-fold cross validation | |
# | |
# Usage: | |
# ./split_file_evenly.pl data_file 10 | |
# | |
# In this case, 10 training and test sets are generated. | |
# |
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
use DateTime; | |
use MIME::Parser; | |
my $dir = shift || Cwd::getcwd(); | |
my $count = 0; | |
my @array = (); | |
touch_emls($dir); |
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
use v5.18; | |
use Net::GitHub; | |
use Encode qw/encode_utf8/; | |
my $github = Net::GitHub->new( # Net::GitHub::V3 | |
access_token => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
); | |
my $repos = $github->repos; |
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
use v5.18; | |
use Net::GitHub; | |
use Encode qw/encode_utf8/; | |
use DDP; | |
my @files = glob "release-*"; | |
my %hash = (); | |
for my $f (@files) { | |
my %release = (); |
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
use v5.18; | |
use Mail::IMAPClient; | |
use File::Slurp; | |
# nohup perl imap-client.pl imap.example.com username password eml_dir 1> importx.log & | |
my $imap_host = $ARGV[0] or die $!; | |
my $user = $ARGV[1] or die $!; | |
my $pass = $ARGV[2] or die $!; | |
my $eml_dir = $ARGV[3] or die $!; |
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
class Response | |
def response_body=(enum) | |
enum.each {|e| puts "res: #{e}" } | |
end | |
end | |
def gen_stream | |
Enumerator.new do |yielder| | |
10.times do |num| | |
puts "stream: #{num}" |
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
# https://www.python.ambitious-engineer.com/archives/2034 | |
import smtplib | |
from email.mime.text import MIMEText | |
# 送受信先 | |
to_email = "xxxxx@gmail.com" | |
from_email = "xxxxx@s3.spaaqs.ne.jp" | |
# MIMETextを作成 |