Skip to content

Instantly share code, notes, and snippets.

Coding for life and fun

Jakub Zomerfeld devzom

Coding for life and fun
View GitHub Profile
devzom / cssCheckOverflowElements.js
Last active Jan 11, 2023
CSS: check and list all overflow'ed HTML elements
View cssCheckOverflowElements.js
// this snippets allow to list all of the elements which overflow page and is wider than HTML <body/>
var docWidth = document.documentElement.offsetWidth;
(el) => {
if (el.offsetWidth > docWidth) {
devzom /
Last active Jan 4, 2023
Git diff & log multicommand
# make git diff from files on 2 branches excluding package-lock.json, filtered by author and date range
git diff branchA branchB -- . ':(exclude)package-lock.json' --pretty=format:"%ad - %an: %s" --after="2022-11-01" --until="2022-12-01" --author="git author" > project_name-author_name-diff-11_2022.doc
#make log from whole project filtered by date range and author
git log branchA branchB --since=4.weeks -p --stat --abbrev-commit --author="author_name" ':(exclude)package-lock.json' > project_name-author_name-diff-01_2023.txt
devzom / zsh-aliases.txt
Last active Nov 16, 2022
zsh: custom aliases
View zsh-aliases.txt
alias zshconfig="open ~/.zshrc"
alias zshsave="source ~/.zshrc"
alias ohmyzsh="open ~/.oh-my-zsh"
# Machine's ip address
alias ip="ipconfig getifaddr en0"
devzom /
Last active Oct 25, 2022
Create example file structure based on .env file
# (generate only keys, without values)
sed 's/=.*/=/' .env >
devzom / git-remove-file-from-whole-history.bash
Created Jul 28, 2022
git: Remove specific file from whole git history
View git-remove-file-from-whole-history.bash
git rm --cached --ignore-unmatch filePath --prune-empty --tag-name-filter cat -- --all
devzom / style.css
Created Mar 19, 2022
CSS: Remove focus outline (when not using keyboard)
View style.css
// removing the focus outline when not using
//keyboard navigation (the CSS :focus-visible selector is polyfilled here).
outline: none;
devzom /
Created Mar 16, 2022
bash: Read .env file variable in Bash
# this will skip search for lines with variable starting with # (hashtag) ex: # VAR1 as its commented out
# Ex: we have .env file with variables:
# #VAR1=123
# VAR2=xyz
# NPM_TOKEN=12312323fdf21313
export "$(grep -vE "^(#.*|\s*)$" .env)"
# didn't respond VAR1 as it contain #, so it's commented out.
# responds with single value ex NPM_TOKEN:
devzom /
Last active Mar 16, 2022
docker: Check if Docker container exist and delete it
# Goal of tghis script is to prompt for Docker container name, if it's skipped it will used infile defined name of container and then will search for specific container and delete it.
# Set container default name as variable
echo -n "Enter Docker container name (if skipped default from file will be used): "
read containerName
# Check if prompted value isNotEmpty
if [ $containerName ]; then
devzom / index.html
Last active Mar 16, 2022
CSS: Animated smooth anchor scroll with anchor margin
View index.html
<!-- step 3 -->
<!-- It's important to add tabindex="-1" to all anchor tags -->
<section id="section1" tabindex="-1">Section 1</section>
devzom / nuxt_JSON-LD_head-SEO.js
Created Mar 5, 2022
Nuxt: Add JSON-LD schema markup for SEO in Nuxt.js
View nuxt_JSON-LD_head-SEO.js
return ({
description:'Description of the site'
title: 'Home page',
meta: [