Skip to content

Instantly share code, notes, and snippets.

View koji-kojiro's full-sized avatar

TANI Kojiro koji-kojiro

  • Osaka, Japan
View GitHub Profile
@koji-kojiro
koji-kojiro / brainfuck.lisp
Last active January 14, 2021 22:56
brainfuck compiler written in Common Lisp (SBCL)
#!/usr/bin/sbcl --script
;;; brainfuck compiler written in Common Lisp (SBCL)
;;; author: TANI Kojiro
;;; usage: `sbcl --script brainfuck.lisp` or `chmod +x brainfuck.lisp; ./brainfuck.lisp`
(declaim ((simple-array (unsigned-byte 8) (*)) *memory*))
(defvar *memory* (make-array 30000 :element-type '(unsigned-byte 8)))
(defvar *pointer* 0)
(defvar *bf-readtable* (make-instance 'readtable))
@koji-kojiro
koji-kojiro / import_from_gist.py
Created December 24, 2016 15:47
[Python] import from Gist
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def load_gist(gist_id):
"""translate Gist ID to URL"""
from json import load
from urllib import urlopen
gist_api = urlopen("https://api.github.com/gists/" + gist_id)