Skip to content

Instantly share code, notes, and snippets.

View skoji's full-sized avatar
:octocat:
Working from home

Satoshi KOJIMA skoji

:octocat:
Working from home
View GitHub Profile
@skoji
skoji / markup-change.md
Last active August 29, 2015 13:57
中間案も追加しました

基本方針

  • 字下げに意味がある記法は採用しない。(NoraMarkの基本的な方針)

現状

見出し

==: など

箇条書き

@skoji
skoji / mini_noramark.pegjs
Last active August 29, 2015 14:00
mini NoraMark parser definition for PEG.js
start
= Document
Document
= EmptyLine* blocks:Block* { return blocks.join("\n"); }
Block
= b:(ExplicitBlock / ParagraphGroup) EmptyLine*
{ return b; }
ExplicitBlockHead
start
= Document
Document
= l:TheLine LF d:Document { d.unshift(l); return d }
/ l:TheLine { return [l]; }
TheLine = DocumentLine / NotAllowedLine
NotAllowedLine = "not allowed" LF { return "not allowed but here."; }
DocumentLine
@skoji
skoji / sample-htmlbook.nora
Last active August 29, 2015 14:01
sample-htmlbook.nora
---
title: サンプル文書
generator: htmlbook
---
#(titlepage) サンプル文書
by Satoshi Kojima
#(preface) 前書き
@skoji
skoji / gist:9359b5f32876b8b32852
Last active August 29, 2015 14:04
デフォルト引数

rubyでメソッドの引数にデフォルト式を渡したとき、その引数が省略されたかどうか知る一番よい方法はなんだろう。

ふつうに

class TheClass
  def the_method(a = nil)
    if a.nil?
        do_something
 else
@skoji
skoji / test.html
Last active August 29, 2015 14:14
「発狂した電車」 部分
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<style type="text/css">
body {
margin: 1em;
writing-mode: vertical-rl;
-webkit-writing-mode: vertical-rl;
@skoji
skoji / remove-slack-settings.sh
Created November 2, 2015 03:34
remove Slack settings (OS X)
rm -rf ~/Library/Application\ Support/Slack/
rm -rf ~/Library/Containers/com.tinyspeck.slackmacgap/
rm -rf ~/Library/Preferences/com.tinyspeck.slackmacgap.plist
rm -rf ~/Library/Saved\ Application\ State/com.tinyspeck.slackmacgap.savedState
rm ~/Library/Safari/LocalStorage/*slack*
@page :first {
margin: 0;
}
@skoji
skoji / zundoko-kiyoshi.ps
Last active March 17, 2016 04:31
ズンドコキヨシ (PostScript版、Ghostscript 9.18で動作確認)
% zundoko-kiyoshi in postscript
/Palatino-Italic findfont 40 scalefont setfont
/height 50 def
clippath pathbbox /top exch def pop pop pop newpath
10 top moveto
/zd {
rand 2 mod 0 eq
@skoji
skoji / .py
Created February 6, 2017 13:50
Convert all fonts opened in Glyphs to TTF
# Write this in Macro Panel and click on the Run button
for myFont in Glyphs.fonts:
for ins in myFont.instances:
print "Exporting:", ins.familyName
ins.generate(Format='TTF',AutoHint=False, RemoveOverlap=False,FontPath='path_to_the_converted_fonts/')