Skip to content

Instantly share code, notes, and snippets.

@motchy869
motchy869 / my_bash_functions.sh
Created September 16, 2025 13:54
My Bash functions
# (Generated by GPT-5)
# Returns the directory of a script file, resolving any symlinks,
# and normalizing to the physical path (no symlink components).
# Usage:
# SCRIPT_DIR="$(script_dir)" # when function is defined in the same script
# SCRIPT_DIR="$(script_dir "${BASH_SOURCE[0]}")" # get caller's script dir (recommended if sourced from a lib)
# Notes:
# - Bash only (uses BASH_SOURCE and [[ ]]).
# - Works on macOS and Linux without relying on 'readlink -f'.
# - For process substitution or stdin execution, there may be no real file path.
@motchy869
motchy869 / my_Excel_formula_examples.md
Created September 14, 2025 01:53
My Excel formula examples

My Excel formula examples

sign-alternating series

=LET(a,1,l,10,a*POWER(-1,MOD(SEQUENCE(l,1,0),2)))

an example to show how to include module only once in Julia
@motchy869
motchy869 / JuliaCallTasting.py
Last active March 26, 2025 11:33
Tasting for JuliaCall
#!/usr/bin/env python3
import os
import numpy as np
import numpy.typing as npt
import juliacall
def main():
jl = juliacall.newmodule('Glob')
jl.println('Hello, world! from Julia.')
@motchy869
motchy869 / Julia_Symbolics_extract_real_imag_parts.ipynb
Last active March 27, 2025 12:49
Extract real/imaginary part in Symbolics.jl
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@motchy869
motchy869 / Julia_Symbolics_extract_num_den.ipynb
Last active March 3, 2025 16:00
Extract numerator and denominator with Symbolics.jl
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@motchy869
motchy869 / quantization-noise_of_sine_wave.ipynb
Created February 19, 2025 12:29
Quantization noise of sine wave
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@motchy869
motchy869 / my_AsciiDoc_template.adoc
Last active July 19, 2026 10:10
My AsciiDoc template

Title

@motchy869
motchy869 / my_LaTeX_Workshop_tools_and_recipes.json
Created January 24, 2025 10:12
My LaTeX Workshop tools & recipes
{
"latex-workshop.latex.recipes": [
{
"name": "lualatex",
"tools": [
"lualatex"
]
},
{
"name": "lualatex -> pythontex -> lualatex",
@motchy869
motchy869 / my_User_Javascript_and_CSS_extension_setting.css
Last active August 6, 2026 05:22
My User Javascript and CSS extension setting
/* for EJJE Weblio */
div#sentence-index-foot-banner {display: none}
#fv_ad_sp {display: none}
div[class*="gliaplayer-container"] {display: none !important;}
#content > aside:nth-child(1) {display: none}
div.ads-loader {display: none}
#content > div.division2 img {display: none}
aside {display: none !important;}
/* for https://www.weblio.jp/ */