Skip to content

Instantly share code, notes, and snippets.

@hnOsmium0001
hnOsmium0001 / README.md
Created December 8, 2023 06:40
Doom Emacs org-mode CJK separate font

这份配置其实并不怎样。它工作原理是这样的:调用 (buffer-face-mode) 以替换当前buffer的默认face,而org-mode所用的各种face都会从默认face继承font-family。我也不太记得为什么要新建一个fontset而不是直接写 (font-spec :family "Blah") 以得到制定好中文字体的face了,大概和不用fontset没法正确设置ASCII范围字符有关吧。

说实话如果不管你用不用Doom Emacs,都应该直接用 (custom-theme-set-faces) 来直接操作 org-default 这个face,总会比这个方案靠谱一些……

@foeken
foeken / tana.css
Last active November 9, 2023 08:45
/* ==UserStyle==
@name app.tana.inc - 10/21/2022, 9:02:58 PM
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A new userstyle
@author Me
==/UserStyle== */
@-moz-document domain("app.tana.inc") {
:root {
--bulletDiameterInner: 6px;
@daeh
daeh / asset-helper.py
Last active September 25, 2023 19:04
Obsidian Templater Helper to Insert Clipboard Contents into MD Notes
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Obsidian Templater Helper to Insert Clipboard Contents into MD Notes
Use Templater to control how Obsidian processes images pasted into notes.
N.B. Its functionality would be better as a plugin. This solution is fairly hacky.
Only tested on MacOS with Python 3.8.
Image in clipboard is saved to:
@bigodel
bigodel / literate-ledger.org
Last active May 20, 2024 14:11
Literate Ledger Programming(?) with Org-mode

Literate Ledger Programming(?) with Org-mode

Recently, given the economic hardships presented by the current pandemic, coupled with the fact that I have started making my own money, I have started to keep track of my finances. I have always known that I would use Ledger, the command line account tool, to manage my money. Ledger was created by an Emacs maintainer, which hints to a very good Emacs integration, and indeed =ledger-mode= offers a great environment for editing, reporting and modifying Ledger files. But even though it is a pretty complete major mode, I missed being

Copy this to roam/js page, including the "{{[[roam/js]]}}" node:
- {{[[roam/js]]}}
- ```javascript
/*
* Roam template PoC by @ViktorTabori
* 0.1alpha
*
* How to install it:
* - go to `roam/js` page`
@jborichevskiy
jborichevskiy / jon-roam-daily-template.md
Last active August 31, 2022 04:41
The daily template I use for Roam Research https://roamresearch.com/
  • Weekly Agenda (created on a different day, and embedded with /Block Reference)
  • [[Morning Questions]]
    • {{[[slider]]}} How many hours of sleep did I get?
    • What's one thing top of mind today?
    • What's the one thing I need to get done today to make progress?
    • Review #[[Index: Questions]] #values
  • Agenda
    • {{[[TODO]]}} Morning walk #goal-health #habit
    • {{[[TODO]]}} Check calendar for scheduled events
  • {{[[TODO]]}} Morning focus hour
@moenn
moenn / wsl_socks5.md
Last active August 12, 2022 14:32
为 windows wsl 配置 socks5 代理

windows代理软件需要开启允许LAN连接

1. 安装 polipo

sudo apt install polipo

2. 配置 polipo

vim /etc/polipo/config
在文件中写入如下内容:

socksParentProxy = "localhost:1080"
socksProxyType = socks5
@wzyboy
wzyboy / fetch-prices.py
Last active May 28, 2024 22:21
Fetch prices from IEX API for Beancount
#!/usr/bin/env python
'''A quick-and-dirty script to fetch prices from IEX API.'''
import sys
import argparse
import requests
from dateutil.parser import parse as parse_datetime
from beancount.core import data
@alphapapa
alphapapa / fitness.org
Last active July 6, 2024 16:48
An Emacs food/weight/workout tracker self-contained in a single Org file

Plots

/home/me/org/double-plot.png

Tasks

@dcragusa
dcragusa / multiindex_to_nested_dict.py
Last active November 6, 2023 11:09
Converts a MultiIndexed Dataframe to a nested dict - this was used in a Django template
import pandas as pd
from collections import OrderedDict
from pandas.core.indexes.multi import MultiIndex
def multiindex_to_nested_dict(df: pd.DataFrame, value_only = False) -> OrderedDict:
if isinstance(df.index, MultiIndex):
return OrderedDict((k, multiindex_to_nested_dict(df.loc[k])) for k in df.index.remove_unused_levels().levels[0])
else:
if value_only:
return OrderedDict((k, df.loc[k].values[0]) for k in df.index)