Tag: software
-
Mac shortcuts to move window to left/right side of screen
Mac has Application shortcut and it can be used to select a menu using a keyboard. We can use that to move the windows. Here’s how I set it. It’s not super convenient as one needs to enter exact text like “Move Window to…”. Also, the application itself should have that exact menu name for…
-
shift+space로 한영 전환
최근 맥 os 업데이트후 shift+space 한영전환이 막혔다. 해결 방법을 찾아 정리해둠. 카라비너를 설치한다. 권한을 주고 실행 후 Settings -> Complex Modification에서 다음 부분을 수정 이후 f18 로 shift+space가 맵핑이 된다. 맥의 settings -> keyboard shortcuts -> input methods에서 next source를 눌러 shift+space를 입력하면 f18이 입력되어 완성! 주의할 점은 karabiner는 어디까지나 키 입력을 받아 키 코드를…
-
Joblib Memory that expires after timelimit
This doesn’t look well documented, but there’s an issue that trackes the problem a solution. I made it a bit simpler to use this way: And then you can use it like
-
poetry is great
There are various tools for creating virtual env and I settled down with poetry. What’s great with poetry is that I can manage dependencies of development and serving. Dependencies of ‘dev’ can be specified using -G. For installing packages for serving, exclude a group as: Poetry creates pyproject.toml to list the packages I added. When…
-
How to add unittest to pre-commit
I was looking for the predefined hooks but then learned that unittest can be easily written myself. What’s in the below runs all tests of the project. If you don’t use poetry, remove ‘poetry run’ from ‘entry’.
-
How to install mongodb on crostini (or, debian bookwarm)
If you come across libssl1.1 issue, there’s an option of installing the library via ubuntu repository OR installing the mongodb itself from ubuntu repository. I personally prefer the latter since I don’t like having a single apt setting just for a single lib. Just follow https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/. If you don’t know if you’re on bookwarm, this…
-
.[x]profile, .[x]rc files
I always forget what those .bash_profile, .bashrc, .zprofile, .zshrc do, so I’m summarizing them here: What does this mean? It’s natural for some code appear in both .profile and .rc, e.g., pyenv recommends it if certain non interactive login shell script relies on the pyenv.
-
Override mathjax in mdbook
If your mdbook is using mathjax v2.x (which is the case when downloading mac binary), you can override its font and expression to trigger mathjax. In book.toml, add the followings And in mathjax-config.js (which should be at the top of your project directory and not under src): Change ‘scale’ to adjust font size. Also, see…
-
Better prompt formatting for LLM uses
One of the typical way to format prompt is using { … } like the below: But it fails as soon as JSON is involved in the input or output. Then, what should we do? My proposal is using string.Template. Its primary purpose is i18n, but it also provides a much more safe formatting, e.g.,…
-
How to erase customization in a wordpress template
It was so painful to find out this. Deleting and reinstalling templates don’t reset the templates to the original one. I tried plugins like wp reset to reset theme, and tried database cleaner to find database table containing the customziation. I connected to the database in a command line and checked all the tables, but…