Skip to content

Instantly share code, notes, and snippets.

@RobertGres
RobertGres / back-end.php
Created February 24, 2021 17:12
Hide emails from bots
<?php
// Using base64_encode as en example
function email_obf_html(string $email): string
{
return sprintf('<span data-obf-email="%s">...</span>', base64_encode($email));
}
function email_obf_mailto_attr(string $email): string
@RobertGres
RobertGres / git-stuff.sh
Last active June 6, 2018 13:35
Git stuff
# Get great explanations for any commands here
# https://explainshell.com/
### Renaming branches
# Rename local branch
# To rename current branch
git branch -m new-name
# To rename another branch
git branch -m old-name new-name
-- Show running (potentially stuck) sql processes
show processlist;
-- Switch to some table
use tablename;
-- Show stuff
show tables;
show databases;
@RobertGres
RobertGres / various-shell-commands.sh
Last active June 7, 2018 15:18
Various shell commands
# Get great explanations for any commands here
# https://explainshell.com/
# Register your ssh key on remote server
# Command should be run on your machine
# more https://www.ssh.com/ssh/copy-id
ssh-copy-id -i ~/.ssh/{mykey} remoteuser@{remoteHostOrIP}
# for generic key
ssh-copy-id remoteuser@{remoteHostOrIP}
# then login only using passphrase