Skip to content

Instantly share code, notes, and snippets.

with
shop_user(id, name, registered_at) as (
values
(1, '33maki', '2020-01-01' at time zone 'jst')
, (2, '23maki', '2020-01-06' at time zone 'jst')
, (3, '13maki', '2020-01-08' at time zone 'jst')
, (4, '25maki', '2020-01-14' at time zone 'jst')
, (5, '36maki', '2020-01-15' at time zone 'jst')
, (6, '21maki', '2020-01-17' at time zone 'jst')
#!/bin/bash
# $ for i in $( find -E ~/Documents/howm/achiku -type d -regex ".*/achiku/[0-9]{4}/[0-9]{2}"); do ./howm2memolist.sh $i; done
p=${1}
for i in $( ls $p ); do
title=$( sed -n '1p' ${1}/${i} | sed -e 's/^# //' -e 's;/;;g')
n=$( echo ${i} | sed -E -e 's/([0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{4})[0-9]{2}.md/\1/' )
cp ${1}/${i} "/Users/chiku/Documents/memolist/achiku/${n}-${title}.md"
#!/bin/bash
for fname in $( ls | grep -v 'a.sh' ); do
dt=$( echo ${fname} | sed -E 's/([0-9]{4}-[0-9]{2}-[0-9]{2})-.*/\1/' )
sdt=$( echo ${dt} | sed -E 's/-/\//g')
title=$( echo ${fname} | sed -E "s/${dt}-//" )
newurl="/post/${fname%%.md}/"
oldurl="/${sdt}/${title%%.md}.html"
cat <<-EOF
aliases:
@achiku
achiku / sqlformat.vim
Last active February 27, 2018 07:46
sqlformat.vim
"" sqlfmt
let g:sqlfmt_command = "sqlformat"
let g:sqlfmt_options = "-r -k lower --comma_first True -"
function! SQLfmtv() range
let tmp = @@
silent normal gvy
let selected = @@
let @@ = tmp
# -*- coding: utf-8 -*-
import random
if __name__ == '__main__':
length = 50
lower = 'abcdefghijklmnopqnstuvwxyz'
upper = 'ABCDEFGHIJKLMNOPQNSTUVWXYZ'
digit = '0123456789'
symbol = '!@#$%^&*_+'
print("-- as always")
print("Hello, World!")
print("-- stdout with newline")
print("I said,")
print("-- stdout without newline")
io.write("Hello, ")
io.write("World! \n")