Skip to content

Instantly share code, notes, and snippets.

View mariomui's full-sized avatar

Mario Mui mariomui

View GitHub Profile
@mariomui
mariomui / example-litnote.md
Created November 5, 2023 21:22
example-litnote
zotero-key zt-attachments title citekey authors
JVKLEV5L
9
The poetry of Du Fu
ΩThe-poetry-of-du-fu_Du-F_2015
Fu Du
Stephen Owen
tag VERSION
_wip
v0.0.1-TCODEID-5

-

This [[experiment-note]] explores the substitution of the renderValue function with my own so that i can attach to the domFragment. Key files are genRenderVfs, which starts the process genListAsDomV2 and customRenderFiles are extraneous middleman.

@mariomui
mariomui / selected-transclusion-preview-by-heading-content.css
Created August 7, 2023 18:43
Preview an embed but only show the content inside of a h1 labeled with "=" (uses cascading philosophy)
/* API specific Feature To ONLY TAKE API BETWEEN = and --- */
/* NAME: SELECTED-TRANSCLUSION-PREVIEW CSS SNIPPET */
.popover.hover-popover .markdown-embed.is-loaded
.markdown-preview-view.markdown-rendered
.markdown-preview-sizer.markdown-preview-section
div:has(> h1[data-heading="-"]) ~ div:not(:has(h1[data-heading="="])) {
display: none;
}
.popover.hover-popover .markdown-embed.is-loaded
.markdown-preview-view.markdown-rendered
@mariomui
mariomui / ui-cornell-callout.css
Created August 6, 2023 08:55
ui-cornell-callout,b.t.-ObsidianMD
/* ## Cornell Callout */
.markdown-source-view.mod-cm6
.cm-contentContainer {
container-type: inline-size;
}
:root {
--ui-cornell-width: 20vw;
}
@mariomui
mariomui / gist:632929f63146b6f151fb8fa9be5f1956
Created March 1, 2022 09:10
Toggle between git personal and git workname, cuz i want to not be restricted
toggle = "!sh -c 'CONFIG_NAME=$(git config user.name) && if [ $CONFIG_NAME = 'MY_PERSONAL_NAME' ]; then git config user.email MY_WORK_EMAIL\
&& git config user.name MY_WORK_NAME;\
else git config user.email PERSONAL_EMAIL\
&& git config user.name PERSONAL_NAME;fi && echo $(git config user.name)'"
@mariomui
mariomui / gist:344f3af892c6682c0b669302b19f0ff5
Last active November 9, 2022 20:44
Custom Segment to detect poetry shell for p10K prompt
: << 'END_COMMENT'
Place this function in your ~/.p10k.zsh file
1) Detects your poetry env, (whehter or not you've entered the directory of your poetry app)
2) Detects whether or not shell is active. (POETRY_ACTIVE)
3) append my_poetry like so:
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
...
my_poetry
)
@mariomui
mariomui / checkdiff.sh
Last active June 14, 2020 09:33
compares local branch name to remote origin
# @usage checkiff master
# @param {posix1} branchname
# @desc notifies you whether local master is the same as origin/master
# (only works in zshell, in bash the piping generaes a subshell)
function checkdiff() {
git fetch;
git diff $1 origin/$1 | wc -l | {read wc};
if (test $wc -ne "0")
then
echo $wc
@mariomui
mariomui / MakeCheckboxes.js
Created April 19, 2020 06:50
Paste this code in chrome console or in snippets, then run. There will be an overlay on your webpage where you can add checkboxes. Used in conjunction with HTML/Markdown editors
console.clear();
function DomManipulator() {
this.error = null;
this.active = false;
this.toggleActive = function toggleActive(shouldSetActiveSetInactive) {
// is this a static method?
if (typeof shouldSetActiveSetInactive === 'boolean') {
this.active = shouldSetActiveSetInactive;
} else {
@mariomui
mariomui / .block
Created August 29, 2019 20:07
fresh block
license: mit
@mariomui
mariomui / .block
Last active August 29, 2019 20:09
fresh block
license: mit