Skip to content

Instantly share code, notes, and snippets.

View MiyamonY's full-sized avatar
🏠
Working from home

MiyamonY

🏠
Working from home
View GitHub Profile
@MiyamonY
MiyamonY / font.org
Last active November 24, 2019 13:12
emacs font setting

font for emacs

現在のフォント

ひらがな

character: れ (displayed as れ) (codepoint 12428, #o30214, #x308c) charset: unicode (Unicode (ISO10646))

@MiyamonY
MiyamonY / macro.org
Last active March 19, 2021 12:35
racket macro detail

racket macro

syntax transformer

syntax transformerとはsyntaxを受け取ってsyntaxを返す関数のこと.

define-syntax によりtransfomer束縛を作っている.syntaxの環境にfooを入れ

@MiyamonY
MiyamonY / macro.rkt
Last active November 10, 2019 09:22
racket macro
#lang racket
(define-syntax foo
(lambda (stx)
(syntax "I am foo")))
(define-syntax (also-foo stx)
(syntax "I am also foo"))
(define-syntax (quated-foo stx)
@MiyamonY
MiyamonY / output.rkt
Created November 9, 2019 15:53
racket output port as string
#lang racket
(require racket/port)
(define (output-string)
(with-output-to-string
(thunk (displayln "ok"))))
(module+ test
(require rackunit)
gcc `pkg-config --cflags gtk+-3.0` -o test test.c `pkg-config --libs gtk+-3.0`
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from flask import Flask, make_response, request
from flask.ext.script import Manager
app = Flask(__name__)
app.debug = True
manager = Manager(app)
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from flask import Flask, make_response
from flask.ext.script import Manager
app = Flask(__name__)
manager = Manager(app)
@app.route('/string/')
def return_string():
type Assoc a b = [(a, b)]
data Prop = Const Bool
| Var Char
| Not Prop
| And Prop Prop
| Imply Prop Prop
p1 :: Prop
p1 = And (Var 'A') (Not (Var 'A'))
import System.IO
import Text.Parsec
import Text.Parsec.String
type Pos = (Int, Int)
goto :: Pos -> IO ()
goto (x, y) = putStr $ "\ESC[" ++ show y ++ ";" ++ show x ++ "H"
beep :: IO ()
import System.IO
type Pos = (Int, Int)
width :: Int
width = 5
height :: Int
height = 5