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
def _justify_list(list1, list2): | |
"""短いほうのリストに空要素を追加して、リストの長さをそろえる""" | |
short_list = min(list1, list2, key=len) | |
c = max(len(list1), len(list2)) - len(short_list) | |
for i in range(0, c): | |
short_list.append('') | |
return list1, list2 | |
def _join_str_list(parent_list, child_list, margin): |
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/sh | |
QUALITY=50 | |
SIZE=120 | |
OUTPUT='thumbnail/'${1%.*}'thumb.jpg' | |
convert -define jpeg:size=${SIZE} -quality ${QUALITY} -thumbnail ${SIZE} ${1} ${OUTPUT} |
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
defmodule Crypto do | |
def gethash(typ, s) do | |
list_to_binary(Enum.map(bitstring_to_list(:crypto.hash(typ, s)), fn(x) -> integer_to_binary(x, 16) end)) | |
end | |
def sha1(s), do: gethash(:sha, s) | |
def md5(s), do: gethash(:md5, s) | |
def sha256(s), do: gethash(:sha256, s) | |
def sha512(s), do: gethash(:sha512, s) | |
end |
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
defmodule Crypto do | |
def md5(s) do | |
list_to_binary(Enum.map(bitstring_to_list(:crypto.md5(s)), fn(x) -> integer_to_binary(x, 16) end)) | |
end | |
end |
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
BEGIN { | |
FS="|" | |
} | |
{ | |
for( i=1; i<=NF; i++ ) { | |
printf( "\"" $i "\"" ",") | |
} | |
printf("\n") | |
} |
NewerOlder