Skip to content

Instantly share code, notes, and snippets.

@hrkt
hrkt / ec2bf.py
Created June 30, 2013 05:32
Exclamation language to brainf*ck language converter.
#!/usr/bin/python
from __future__ import with_statement
import sys
"""
Exclamation language to Brainf*ck langage converter.
30 6 2013 Hiroki Ito
Exclamation programs can be translated into Brainf*ck using these substitutions
@hrkt
hrkt / brainfuck.py
Created June 30, 2013 05:34
A brainf*ck language interpreter.
#!/usr/bin/python
import sys
write = sys.stdout.write
# debug mode flag (True/False)
DEBUG_MODE = False
def dp(str):
if(DEBUG_MODE):
print str
@hrkt
hrkt / bf2ec.py
Last active December 19, 2015 03:59
Brainf*ck language to Exclamation language converter.
#!/usr/bin/python
"""
Brainf*ck langage to Exclamation language converter.
30 6 2013 Hiroki Ito
Exclamation programs can be translated into Brainf*ck using these substitutions
exclamation bf C
! + ++*ptr;
!! > ++ptr;
@hrkt
hrkt / init.el
Created January 24, 2015 06:46
sample init.el (Emacs24.3 , Tab, dark-theme)
;; Last modified : 2015/1/24
;;
;; package
(require 'package)
(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) ; Org-mode's repository
(package-initialize)
@hrkt
hrkt / build.sh
Last active August 29, 2015 14:14
download rhino&engine and run sample
#!/bin/sh
# 2015/2/1
#
# A script for downloading rhino & engine source, build jars, and write & execute simple program.
#
# see https://java.net/projects/Scripting
# https://wiki.openjdk.java.net/display/Nashorn/Using+Rhino+JSR-223+engine+with+JDK8
# change this variable
RHINO_VERSION=rhino1.8.0-SNAPSHOT
@hrkt
hrkt / cleanup_rish.sh
Created February 27, 2015 15:35
Try rhino-shell as login shell
#!/bin/sh -x
rm -rf /opt/rhino
sed -i -e "s/\/opt\/rhino\/rish//g" /etc/shells
1. disable
```
$ sudo nvram SystemAudioVolume=%80
```
2. enable
```
$ sudo nvram-d SystemAudioVolume
```
@hrkt
hrkt / gist:ae4eb1b7a6203407e7598c18e03be0be
Created July 1, 2019 21:07
Add to Gootle Bookmark(bookmarklet)
javascript:(function(){var a=window;b=document;c=encodeURIComponent;s=a.parent.screen;d=a.open("http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+c(b.location)+"&title="+c(b.title),"_b1","width="+.8*s.width+",height="+.8*s.height+",resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},100)})();
# screenrc
#
# see also
#
# arch linux wiki
# https://wiki.archlinux.org/index.php/GNU_Screen
# GNU Screen manual
# https://www.gnu.org/software/screen/manual/screen.html#Overview
# scroll buffer (press Ctrl-J esc to enter copy-mode, press ESC to leave copy-mode)
@hrkt
hrkt / gist:8169201a089364c1b7a763fbd04d30ac
Created February 13, 2020 20:54
install_docker_latest_on_centos.sh
#!/bin/bash
https://docs.docker.com/install/linux/docker-ce/centos/
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \