Skip to content

Instantly share code, notes, and snippets.

@atomtigerzoo
atomtigerzoo / addSFTPonlyUser.sh
Created March 18, 2025 14:10
Script to create a user for SFTPonly / chrooted access for deploys via sftp
#!/bin/bash
#
# The group 'sftponly' needs to exist
# $ groupadd sftponly
# Update ssh to allow new group and use chroot
# $ nano /etc/ssh/sshd_config
#
# Match Group sftponly
# ChrootDirectory %h
@atomtigerzoo
atomtigerzoo / text-marker-highlight-fill-animation.html
Created October 19, 2024 08:39
CSS text marker effect with animation & multi-line wrapping
<style>
mark{
animation: 1.5s highlight 1.25s 1 normal forwards;
background-color: none;
background: linear-gradient(90deg, theme('colors.amber.200') 50%, theme('colors.transparent') 50%);
background-size: 200% 100%;
background-position: 100% 0;
}
@keyframes highlight{
@atomtigerzoo
atomtigerzoo / .zshrc
Last active March 18, 2025 14:14
zsh-oh-my-zsh_show-notice-on-directory-change
# [...your .zshrc file]
# Append this to your .zshrc (you need to have zsh/oh my zsh installed 🙃)
# Watch folder changes
function chpwd {
if [[ -e .nvmrc ]]; then
# If above file is found inside folder, display the following
echo
echo ✨ nvmrc dotfile found
<?php
/*
This specific case creates a new route/URl to display Wordpress
posts from a fixed category with a parameter-based taxonomy
term with a custom template.
Needs template file: custom-template_category-tax_term.php
Inside the template you can fetch the query-var with:
$wp_query->get('my_tax_query_var')
@atomtigerzoo
atomtigerzoo / plain-css-sticky-footer.css
Created March 2, 2020 16:08
Create a sticky footer with Tailwindcss (or just with plain CSS)
@atomtigerzoo
atomtigerzoo / functions-oembed.php
Last active May 18, 2020 13:12
Wordpress: responsive oembeds - youtube, vimeo, images, etc
/*
Creates a container around embeds
*/
function responsive_embed_wrapper($content) {
return '<figure class="oembed-wrap">' . $content . '</figure>';
}
add_filter('embed_oembed_html', 'responsive_embed_wrapper', 10, 3);
@atomtigerzoo
atomtigerzoo / check-mount-point.sh
Created July 11, 2018 09:01
Simple bash script to check if a mount point has been mounted, and if not, re-mount it or notify someone via email
#!/bin/bash
MOUNTPOINT="/some/mount-point"
EMAIL="[email protected]"
if cat /proc/mounts | grep ${MOUNTPOINT} > /dev/null; then
echo "${MOUNTPOINT} already mounted."
exit 0
fi
@atomtigerzoo
atomtigerzoo / fail2ban_block-ip-from-commandline.md
Last active February 4, 2018 15:34
Block IP with fail2ban from command line

A quick block for clients that bother you somehow or do malicious stuff.

List your jails

 sudo fail2ban-client status

Choose the jail you want to block the IP from/add it to.

Block the IP

@atomtigerzoo
atomtigerzoo / break-long-words-with-hypens.css
Created December 29, 2017 06:14
CSS: break long words with auto-hyphens
.hyphen-long-words{
hyphens: auto;
overflow-wrap: break-word;
}
@atomtigerzoo
atomtigerzoo / gh-pages-deploy.md
Created August 29, 2017 08:47 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).