Skip to content

Instantly share code, notes, and snippets.

@geodenx
geodenx / emacs-mac.patch
Last active May 27, 2025 23:52
Homebrew Emacs Mac Port Formula Patch (29.1 -> 29.4)
diff --git a/Formula/emacs-mac.rb b/Formula/emacs-mac.rb
index 3639932..8c31129 100644
--- a/Formula/emacs-mac.rb
+++ b/Formula/emacs-mac.rb
@@ -10,16 +10,9 @@ class EmacsMac < Formula
desc "YAMAMOTO Mitsuharu's Mac port of GNU Emacs"
homepage "https://www.gnu.org/software/emacs/"
stable do
- url "https://bitbucket.org/mituharu/emacs-mac/get/65c6c96f27afa446df6f9d8eff63f9cc012cc738.tar.gz"
- version "emacs-29.1-mac-10.0"
@geodenx
geodenx / acceleration_sensors.md
Last active April 28, 2024 14:28
Acceleration Sensors

Configurations

  1. PIC16F84 + ADXL202
  2. H8/3694F + ACB302 + EEPROM

PIC16F84 + ADXL202

Parts

  • PC connected micon 2 axis acceleration sensor module kit [akizukidenshi.com]
  • PIC16F628: pin compable with PIC16F84
  • ADXL202
@geodenx
geodenx / cpld_verilog.md
Last active April 28, 2024 08:07
Learning CPLD using Verilog

CQ出版『VHDLで学ぶCPLD学習セット』を Quartus II と Verilog-HDL で開発する方法

CQ出版 DesignWave 『VHDLで学ぶCPLD学習セット』は、 Altera の CPLD (MAX7032) を用い、VHDL を Max+PlusII で合成し、実際に動かしてみるという学習セットです。現在(2003年12月)、LeonardoSpectrum-Altera のライセンスが切れてしまったためか、この学習セットは販売されていません。ライセンスが切れたからといって使えないというのももったいないので、Max+PlusII の代わりに Quartus II を用いて利用する方法を紹介します。

image

学習セットでは VHDL での開発方法が記載されていますが、ここでは Verilog を用いています。

「毎日コミュニケーションズ『CPUの創り方』に掲載されている TD4 CPU を CQ出版『DesignWave 2003年1月号』付録 CPLD 上に実装」は geodenx/td4 に移しました。

@geodenx
geodenx / init-toggle-cursor-color.el
Last active August 25, 2023 00:37
function for .emacs to toggle cursor color even under multiple Modus themes
(defun toggle-cursor-color ()
"Change cursor color depending on input source for Modus themes"
(set-cursor-color (if (string-match "\\.ABC$" (mac-input-source))
(modus-themes-with-colors cursor) "#3C7AF0")))
(add-hook 'mac-selected-keyboard-input-source-change-hook
'toggle-cursor-color)
@geodenx
geodenx / init-matlab.el
Last active July 15, 2022 16:16
Disable prefix key C-h for matlab-shell in Emacs matlab-mode, and map it to delete-backward-char
(defun remap-ctrlh-matlab-mode ()
"Remap prefix key C-h in matlab-mode"
(define-key matlab-mode-map "\C-h" #'delete-backward-char))
(add-hook 'matlab-mode-hook 'remap-ctrlh-matlab-mode)
@geodenx
geodenx / server-start-tramp.el
Last active December 24, 2023 17:26
Emacs Lisp function for init.el to server-start with scp TCP configuration file for remote emacsclient
;; C-x d /-::
(setq tramp-default-method "scpx")
(setq tramp-default-host "remote")
(setq server-host "localhost" ; implicit declaration would be required for server-start-tramp
server-use-tcp t
server-port 9999)
;; $ vi ~/.ssh/config
;; Host remote
;; Hostname %h.example.com
;; RemoteForward 9999 localhost:9999
@geodenx
geodenx / emacsclient
Last active May 6, 2022 04:15
emacsclient wrapper without --tramp option for Emacs <26.1, can be used even with emacsclient 26.1+
#!/bin/bash
# Wrapper for emacsclient without --tramp option before Emacs version 26.1
# If /usr/bin/emacsclient is 26.1 or later, this script simply passes arguments to it.
# Usage
# configure following environment variables in .bashrc etc.
# export EMACS_SERVER_FILE=server
# export EMACSCLIENT_TRAMP=/-:: # tramp-default-method and tramp-default-host required in init.d
EMACSCLIENT=/usr/bin/emacsclient
@geodenx
geodenx / align_displays.sh
Created June 2, 2021 12:14
align displays at Y=0
#!/bin/sh
displayplacer list | grep ^displayplacer | sed -e 's/,[0-9\-]*)/,0)/g' | sh
@geodenx
geodenx / bat
Last active August 19, 2020 00:31
Install bat - a cat(1) clone with syntax highlighting and Git integration - to Ubuntu 16.04 ppc64el
$ sudo apt-get install rustc llvm libclang-3.8
$ git clone git@github.com:sharkdp/bat.git
$ cd bat
$ cargo install bat
@geodenx
geodenx / init-box-autosave.el
Created June 15, 2017 01:27
Store auto-save files for BoxSync into a local temporary directory as auto-save files for remote files.
(add-to-list 'auto-save-file-name-transforms
`("\\`/Users/$USER/BoxSync/\\([^/]*/\\)*\\([^/]*\\)\\'",
(concat temporary-file-directory "\\2") t))