Skip to content

Instantly share code, notes, and snippets.

View ochoarobert1's full-sized avatar
🏠
Working from home

Robert Ochoa ochoarobert1

🏠
Working from home
View GitHub Profile
@ochoarobert1
ochoarobert1 / .bashrc
Created July 27, 2023 15:52
bashrc template
# Adding OhMyPosh Styling
eval "$(oh-my-posh init bash --config ~/AppData/Local/Programs/oh-my-posh/themes/tonybaloney.omp.json)"
# Start SSH Agent
#----------------------------
SSH_ENV="$HOME/.ssh/environment"
function run_ssh_env {
. "${SSH_ENV}" > /dev/null
}
@ochoarobert1
ochoarobert1 / elementor.php
Last active February 6, 2024 14:11
Dinamically add all Elementor widgets inside hello elementor child theme
<?php
class CustomElementorWidgets
{
public function __construct()
{
add_action('wp_enqueue_scripts', [$this, 'widgets_dependencies'], 80);
add_action('elementor/widgets/register', [$this, 'widgets_register']);
}
@ochoarobert1
ochoarobert1 / nginx.conf
Created July 11, 2023 12:48
WordPress Multisite .htaccess bug on Nginx
# MULTISITE CONFIGURATION
if ( $uri ~ "files" ) {
rewrite ^/(?:.*/)?files/(.+) /wp-includes/ms-files.php?file=$1;
}
if (!-e $request_filename) {
rewrite ^/[_0-9a-zA-Z-]+(/wp-(content|admin|includes).*) $1 break;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 break;
}
@ochoarobert1
ochoarobert1 / .htaccess
Last active July 11, 2023 12:47
WordPress Multisite .htaccess bug on Apache
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
@ochoarobert1
ochoarobert1 / .gitconfig
Last active July 11, 2023 12:51
gitconfig modular config
# in the modular files, add only [user] properties
[user]
name = Your Name
email = youremail@gmail.com
[winUpdater]
recentlySeenVersion = 2.25.0.windows.1
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
@ochoarobert1
ochoarobert1 / .bashrc
Created July 11, 2023 12:38
Bash config to call automatically different ssh keys
# Add this on .bashrc
# Start SSH Agent
#----------------------------
SSH_ENV="$HOME/.ssh/environment"
function run_ssh_env {
. "${SSH_ENV}" > /dev/null
}