Skip to content

Instantly share code, notes, and snippets.

View rummelonp's full-sized avatar
🐈‍⬛
ニャーン

Kazuya Takeshima rummelonp

🐈‍⬛
ニャーン
View GitHub Profile
@rummelonp
rummelonp / cperl-imenu.el
Created March 15, 2024 06:12 — forked from syohex/cperl-imenu.el
my own perl imenu. Default imenu provides too many information for me
(defun my/cperl-imenu-create-index ()
(let (index)
;; collect subroutine
(goto-char (point-min))
(while (re-search-forward "^\\s-*sub\\s-+\\([^ ]+\\)" nil t)
(push (cons (format "Function: %s" (match-string 1))
(match-beginning 1)) index))
;; collect subtest
(goto-char (point-min))
cask 'font-juisee' do
version 'v0.0.2'
sha256 'bf13b729d96eb4821aceda82189a67ee4584b37655e610b6b5e21b0fb9669288'
url 'https://github.com/yuru7/juisee/releases/download/v0.0.2/Juisee_v0.0.2.zip'
name 'Juisee'
desc 'Juisee は、欧文フォント JuliaMono と日本語フォント LINE Seed JP を合成したプログラミング向けフォントです。'
homepage 'https://github.com/yuru7/juisee'
font 'Juisee_v0.0.2/Juisee-Bold.ttf'
@rummelonp
rummelonp / sbbp.rb
Created June 14, 2023 09:35
サカバンバスピス
# frozen_string_literal: true
sbbp = 'サカバンバスピス'
words = sbbp.each_char.each_slice(2).map(&:join)
loop do
result = Array.new(words.size) { words.sample }.join
puts result
sleep 0.02
break if result == sbbp
cask 'font-0xproto' do
version '1.000'
sha256 'f841469706c249a55f1425c4cd2da97fc8c272fda6e7a0d52ecf17a405c4b717'
url 'https://github.com/0xType/0xProto/releases/download/1.000/0xProto_1_000.zip'
name '0xProto'
desc 'Free and Open-source font for programming.'
homepage 'https://github.com/0xType/0xProto'
font 'fonts/0xProto-Regular.otf'
@rummelonp
rummelonp / tsconfig.json
Created June 25, 2022 09:01
create-react-app した後に設定する tsconfig.json 2022
{
"compilerOptions": {
"incremental": true,
"target": "es5",
"module": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": false,
"jsx": "react-jsx",
"noEmit": true,
"isolatedModules": true,
@rummelonp
rummelonp / activestorage.d.ts
Created June 22, 2022 11:59
@types/activestorage が最新に追従出来てないので雑対応
declare module '@rails/activestorage' {
export function start(): void
export class DirectUpload {
id: number
file: File
url: string
constructor(file: File, url: string, serviceName: string, attachmentName: string, delegate?: DirectUploadDelegate)
@rummelonp
rummelonp / build.sh
Last active June 2, 2022 19:41
Rust で Linux 向けのやつも Mac でビルドする
# $ cargo install cross
# $ rustup target add aarch64-apple-darwin
# $ rustup target add x86_64-apple-darwin
# $ rustup target add aarch64-unknown-linux-gnu
# $ rustup target add x86_64-unknown-linux-gnu
# $ brew tap messense/homebrew-macos-cross-toolchains
# $ brew install aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu
export CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-gcc
@rummelonp
rummelonp / my-indent-and-save-all-buffers.el
Created April 23, 2022 00:06
emacs で開いてる全バッファまとめてインデントするやつ
(defun my/indent-and-save-all-buffers ()
(interactive)
(dolist (buffer (buffer-list))
(unless (string-match-p "*" (buffer-name buffer))
(save-excursion
(switch-to-buffer buffer)
(indent-region (point-min) (point-max))
(save-some-buffers t)))))
@rummelonp
rummelonp / neotree-ext.el
Created April 21, 2022 19:08
neotree.el をなんか良い感じに動かすやつ
;; ← 押した時
;;
;; ファイルだったら: 前の行に移動
;; 開いたディレクトリだったら: 閉じる
;; 閉じたディレクトリだったら: 上の階層に移動
(defun neotree-left (arg)
(interactive "P")
(let* ((path (neo-buffer--get-filename-current-line))
(file-p (and path (not (file-directory-p path)))))
(cond (file-p
@rummelonp
rummelonp / init-rainbow-delimiters.el
Last active April 27, 2022 19:03
helm-major-mode で rainbow-delimiters-mode を有効にするとハイライトが死ぬので除外
(require 'rainbow-delimiters)
(defun rainbow-delimiters-mode-maybe ()
(unless (or (minibufferp) (eq major-mode 'helm-major-mode))
(rainbow-delimiters-mode-enable)))
(define-globalized-minor-mode global-rainbow-delimiters-mode
rainbow-delimiters-mode rainbow-delimiters-mode-maybe)
(global-rainbow-delimiters-mode)