Skip to content

Instantly share code, notes, and snippets.

View IlanVivanco's full-sized avatar
💡
Coding!

Ilán Vivanco IlanVivanco

💡
Coding!
View GitHub Profile
@IlanVivanco
IlanVivanco / get-posts.php
Last active March 7, 2024 20:20
Get post data from DB
<?php
// Hook into the admin menu action to add the options page.
add_action( 'admin_menu', 'epic_add_admin_page' );
function epic_add_admin_page() {
// Add a new submenu page under Settings tab
add_submenu_page(
'options-general.php',
'Epic Posts Listing',
@IlanVivanco
IlanVivanco / wp-redirects.php
Last active February 13, 2024 22:41
WP Redirect Log
<?php
/**
* Plugin Name: Debug - WP Redirect
* Description: Adds debugging output to the HTTP header response to find out which file/function triggered a redirect.
* Author: Philipp Stracker
* Author URI: http://www.stracker.net/
* Created: 15.09.2015
* Version: 1.0.0
*
* Simply activate the plugin and it will add debugging information to all
@IlanVivanco
IlanVivanco / instrctuvo.md
Last active January 17, 2024 02:59
Musihaks CSS hacks

Pequeños hacks CSS para Musihacks

Pueden aplicar los estilos que vaya recopilando en style.css utilizando alguna extensión del navegador que permita agregar estilos personalizados. En mi caso, estoy utilizando User CSS para Edge/Chorme.

Cualquier recomendación o comentario es más que bienvenido.

while read line; do awk '{print $2}' <(curl -ISs $line | grep location) >> headers.txt; done < urls.txt
@IlanVivanco
IlanVivanco / cache.php
Last active February 5, 2024 16:08
Clear all possible WP cache systems
<?php
if ( ! function_exists( 'lets_clear_cache' ) ) {
function lets_clear_cache() {
// WP Rocket
if ( function_exists( 'rocket_clean_domain' ) ) {
rocket_clean_domain();
}
// W3 Total Cache : w3tc
@IlanVivanco
IlanVivanco / commands.md
Last active November 1, 2021 19:57
Util git scripts

Remove dead branches

Removes merged branches that are already deleted from the remote repository, but they are still on your local machine.

git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d

Add this command as git alias

@IlanVivanco
IlanVivanco / config.md
Last active September 3, 2021 13:48
Xdebug config for Devilbox

Extracted from cytopia/devilbox#718 issue

  • ~/.zshrc or ~/.bashrc
export IP=$(hostname -I)
  • _~/.devilbox/.env
PROJECTS_PATH=~/code
@IlanVivanco
IlanVivanco / devilbox.sh
Last active September 3, 2021 13:53
Utils function for managing Devilbox's virtual hosts
dvb-create-host() {
# Vars
BASE_DIR="~/www/$1/htdocs"
DB_NAME="$1_db"
DB_HOST="mysql"
DB_USER="root"
DB_PASS=""
WP_URL="$1.local"
WP_USER="ilan"
@IlanVivanco
IlanVivanco / cron.yml
Last active May 12, 2021 10:16
Github workflow cron
# .github/workflows/cron.yml
# You must add your YOUR_BUILD_HOOK from your repo > Settings > Secrets
name: Trigger Netlify Build
on:
schedule:
# Run at 0815 daily
- cron: '15 8 * * *'
jobs:
build:
@IlanVivanco
IlanVivanco / phpcs.xml
Last active March 8, 2024 17:09
PHPCS WordPress coding standards config file
<?xml version="1.0"?>
<ruleset name="WordPress Theme Coding Standards"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>A custom set of rules to check for a WPized WordPress project</description>
<!-- General PHPCS config. -->
<file>.</file>
<arg value="sp"/>
<arg name="extensions" value="php"/>