nextjs config
Sat 04. April 2026 | 2026-04-04next.config.js og webpack.config.js
next.config.js er en slags utvidelse til webpack.config.js . Man har ikke direkte tilgang til webpack-filen, men man kan bruke next config filaslik jeg forstår dette sitatet i hvert fall:
Imagine your
next.config.jsas something to append to an existingwebpack.configbehind the scenes. You won't have direct access to the webpack but you can extend it.
se https://stackoverflow.com/questions/50746420/nextjs-import-images-in-mdx supersizze sin melding
Create & apply patches
Sat 04. April 2026 | 2026-04-04
https://stackoverflow.com/questions/2249852/how-to-apply-a-patch-generated-with-git-format-patch
First the stats:
git apply --stat a_file.patch
Then a dry run to detect errors:
git apply --check a_file.patch
Finally, you can use git am to apply your patch as a commit. This also allows you to sign off an applied patch.
This can be useful for later reference.
git am --keep-cr --signoff < a_file.patch
text
Sat 04. April 2026 | 2026-04-04mulig du må fjerne denne blueprint.md filen og referansen til den i cloudcannon config'en for at schema'et skal bli brukt.
lalala test
Wed 01. April 2026 | 2026-04-01Cloudcannon test add "new post" via UI
CSS position floatish relative
Wed 01. April 2026 | 2026-04-01https://css-tricks.com/almanac/properties/p/position/#absolute
To make the child element positioned absolutely from its parent element we need to set this on the parent element itself:
.element {
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
.parent {
position: relative;
}
Now properties such as left, right, bottom and top will refer to the parent element, so that if we make the child element transparent we can see it sitting right at the bottom of the parent:
Undo `git reset --soft HEAD~1` with reflog
Thu 19. March 2026 | 2026-03-19git reflogfind commit before resetgit checkout <commit>git logverify that this commit includes the resetted commitgit branch --force <original-branch-name>git checkout <original-branch-name>
References
git history for selection
Wed 18. March 2026 | 2026-03-18Visual mark code
Webstorm: "Show history for selection"
Neovim: :<,>DiffviewFileHistory<CR>
markdown
Tue 10. March 2026 | 2026-03-10<mark>Highlighted text</mark>
==Highlighted text==
Highlighted text
==Highlighted text==
[!NOTE] En note
[!WARNING] Warning!!
[!IMPORTANT] !!!!!!
Tmux kill pane/window
Thu 05. March 2026 | 2026-03-05Kill window/pane in tmux
<Prefix>&for killing a window
<Prefix>xfor killing a paneIf there is only one pane (i.e. the window is not split into multiple panes,
x would kill the window)
https://stackoverflow.com/questions/7771557/how-do-i-terminate-a-window-in-tmux
Usage for killing tmux windows/pane:
- if nvim freezes during
:<,>DiffviewFileHistoryor something
Check if a file exists (pre-push example)
Tue 03. March 2026 | 2026-03-03Bash
Search replace in pre-push(.sample)
# 1: new branch name
function update_prepush {
sed -i'' -e "s/allowed_branch_name=\".*\"/allowed_branch_name=\"$1\"/g" $(gitHookFull pre-push)
}
#1: name of git hook (e.g. pre-push, post-commit)
function gitHookFull {
if [[ -f ".git/hooks/$1" ]]; then
echo ".git/hooks/$1"
else
if [[ -f ".git/hooks/$1.sample" ]]; then
echo ".git/hooks/$1.sample"
else
echo "undefined"
fi
fi
}
Check existence
lpo() {
if [[ -f ".git/hooks/pre-push" ]]; then
echo ".git/hooks/pre-push was found:"
echo "pre-push is activated"
else
if [[ -f ".git/hooks/pre-push.sample" ]]; then
echo ".git/hooks/pre-push was not found:"
echo "but .git/hooks/pre-push.sample was found:"
echo "pre-push is deactivated"
else
echo "Hmmmmm"
fi
fi
}
Nvim edit file
po() {
if [[ -f ".git/hooks/pre-push" ]]; then
echo ".git/hooks/pre-push was found:"
nvim .git/hooks/pre-push
else
if [[ -f ".git/hooks/pre-push.sample" ]]; then
echo ".git/hooks/pre-push was not found:"
echo "but .git/hooks/pre-push.sample was found:"
nvim .git/hooks/pre-push.sample
else
echo "Hmmmmm"
fi
fi
}
Lua nvim edit file
function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
function open_prepush()
if file_exists(".git/hooks/pre-push") then
vim.cmd("vsplit .git/hooks/pre-push")
elseif file_exists(".git/hooks/pre-push.sample") then
vim.cmd("vsplit .git/hooks/pre-push.sample")
else
vim.cmd("echo 'Hmmmmm'")
end
end
vim.keymap.set("n", "<leader><leader>po", open_prepush, { desc = "Open pre-push a new split" })
Print current date
Wed 25. February 2026 | 2026-02-25Print current date with Mac Shortcuts app





- Ctrl Alt a ---> 2026-02-25
- Ctrl Alt s ---> 25.02.2026
This card is mentioned in: https://useful-snippets.netlify.app/posts/autohotkey-replacements/