Skip to content

Instantly share code, notes, and snippets.

View mahito1594's full-sized avatar
I'm turning coffee into...?

Mahito TANNO mahito1594

I'm turning coffee into...?
View GitHub Profile
@mahito1594
mahito1594 / fizzbuzz.el
Last active August 27, 2022 10:28
FizzBuzz with Emacs Lisp
;; Set max-lisp-eval-depth to some lower const, e.g., 600
(setq max-lisp-eval-depth 600)
(defun fizzbuzz--check (number)
"Check given number and then print Fizz / Buzz / FizzBuzz or itself."
(cond
((= (% number 15) 0) "FizzBuzz")
((= (% number 5) 0) "Buzz")
((= (% number 3) 0) "Fizz")
(t (number-to-string number))))
@mahito1594
mahito1594 / rename-flac
Created March 23, 2020 13:43
Rename FLAC files based on its metadata
#! /bin/bash
################################################################################
#
# TL; DR
# This script rename filename.flac to
# <Album Artist>/<Album Title>/Disc <Disc Number> - Track <Track Number>.flac
#
# Usage:
# rename-flac [filename]
@mahito1594
mahito1594 / ltx2utf.py
Last active May 16, 2019 16:24
`.bib` 内のアクセント付き文字の unicode <-> LaTeX command 変換用スクリプト
#! /usr/bin/env python3
# Copyright (C) 2019 Mahito TANNO
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
@mahito1594
mahito1594 / init.el
Last active April 19, 2019 15:37
My Emacs configure for YaTeX-mode, see http://mtino1594.hatenablog.com/entry/2019/04/07/200000
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(unless package-archive-contents (package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
(use-package company