Skip to content

Instantly share code, notes, and snippets.

View sukeharu's full-sized avatar

Sukeharu Kano sukeharu

View GitHub Profile
@sukeharu
sukeharu / list-style.html
Last active May 8, 2020 06:27
2020/05/08現在、list-style-typeに指定できる、日本語に関連するキーワード。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>list-style</title>
<style>
p > code {
padding-left: 0.5rem;
}
@sukeharu
sukeharu / hugo_shortcodes_gist.md
Created November 4, 2018 02:55
Hugo Shortcodes embed GitHub Gist

{{< gist username document_name >}}

@sukeharu
sukeharu / hugo_shortcodes_figure.md
Last active October 2, 2022 11:02
Hugo Shortcodes embed <figure> tag

Basic usage:
{{< figure src="path/to/image.png" >}}

add figcaption:
{{< figure src="path/to/image.png" caption="figure caption" >}}

set width:
{{< figure src="path/to/image.png" caption="figure caption" width="500" >}}

@sukeharu
sukeharu / four-digit.scpt
Last active June 2, 2017 07:07
Get four digit numbers as string from the right end of the unix time number, then set it to the clipboard by AppleScript.
set d to (do shell script "d=`date +%s`;echo ${d:(-4)}")
set the clipboard to d
@sukeharu
sukeharu / openInTerminalAndSublimeText.scpt
Last active May 6, 2017 11:25
Open in Terminal and Sublime Text AppleScript
on run {input, parameters}
tell application "Terminal"
activate
tell front document
do script "cd " & input & "; subl ."
end tell
end tell
return input
@sukeharu
sukeharu / scrivener.md
Last active September 7, 2016 10:35
Scrivener で自分がよくやる操作メモ

Scrivener で自分がよくやる操作メモ

  • 選択したテキストをドキュメントのタイトルにする(英語メニュー:Documents -> Set Selected Text as Title)
opt + shift + cmd + T
  • リンクの名前をリンク先のタイトルで更新する(英語メニュー:Edit -> Update Links To Use Target Title)
@sukeharu
sukeharu / redirect.md
Last active July 13, 2016 16:49
Apache 2.x で、特定のディレクトリを除きリダイレクトする方法。

Apache 2.x で、特定のディレクトリを除いてリダイレクト

サイトのすべてのファイルを http://www.example.com にリダイレクトする。ただし、dir1ディレクトリ以下は除外する(リダイレクトしない)。

RedirectMatch 301 "^/((?!dir1).*)$" http://www.example.com/

除外するディレクトリが複数ある場合、たとえばdir1だけでなくdir2以下も除外するときはこうする。

RedirectMatch 301 "^/((?!(dir1|dir2)).*)$" http://www.example.com/
@sukeharu
sukeharu / gist:d6af98f5408f582e1206
Last active March 6, 2016 06:30
Raspberry Pi List all installed packages
# Output installed packages list in terminal(less)
$ dpkg --get-selections | less
# or if you want to output into text file, do like this.
$ dpkg --get-selections > installed.txt