Skip to content

Instantly share code, notes, and snippets.

Avatar
💯
Focusing

Adrián Barrio Andrés statickidz

💯
Focusing
View GitHub Profile
@statickidz
statickidz / replace_emails_sql_txt_csv
Created Nov 2, 2020
Replace emails in Visual Studio Code
View replace_emails_sql_txt_csv
Search: \b[A-Z0-9._%-]+@
Replace: staging_$0
@statickidz
statickidz / functions.php
Last active Feb 9, 2020
Woocommerce - External Links New Tab for Affiliates
View functions.php
<?php
/**
* @snippet Woocommerce - External Links New Tab for Affiliates
* @sourcecode https://gist.github.com/statickidz/72be96dca9cd39331f1fcbdc59392f5b
* @author Adrián Barrio Andrés (statickidz.com)
*/
/**
* Redirect WC external products single to his affiliate link
@statickidz
statickidz / functions.php
Last active Sep 17, 2021
Woocommerce - Show Custom Filter and Admin Column for Catalog Visibility
View functions.php
<?php
/**
* @snippet Show Custom Filter and Admin Column for Catalog Visibility @ WooCommerce Products Admin
* @sourcecode https://gist.github.com/statickidz/6a539550d8e0d13d2c3d12318672e816
* @author Adrián Barrio Andrés (statickidz.com)
*/
add_filter('woocommerce_product_filters', 'skidz_filter_by_catalog_visibility_dashboard_products');
@statickidz
statickidz / docker-compose.yml
Created Nov 5, 2019
Quick Docker Compose for Wordpress testing (docker-compose up -d)
View docker-compose.yml
version: '3.3'
services:
mysql:
image: mysql:5.7.22
volumes:
- ./.mysql:/var/lib/mysql/
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
View keybase.md

Keybase proof

I hereby claim:

  • I am statickidz on github.
  • I am skidz (https://keybase.io/skidz) on keybase.
  • I have a public key ASBtgRaCsTa5XJbiKIJUcna4qSMa20J-QGFahsoxAq6pjAo

To claim this, I am signing this object:

@statickidz
statickidz / cronjob-certbot.config
Created Jul 14, 2019
Elastic Beanstalk single instance HTTPS with Let's Encrypt
View cronjob-certbot.config
files:
"/etc/cron.d/certbot":
mode: "000644"
owner: root
group: root
content: |
56 1 * * * root /opt/certbot/certbot-auto renew
commands:
remove_old_cron:
command: "rm -f /etc/cron.d/*.bak"
@statickidz
statickidz / .bash_profile
Last active Oct 6, 2019
ANDROID_HOME and JAVA_HOME environment variable for Mac OSX
View .bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export ANDROID_SDK_ROOT=/Users/$USER/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH="$HOME/.fastlane/bin:$PATH"
source ~/.nvm/nvm.sh
@statickidz
statickidz / hex_rgba_alpha.txt
Last active Oct 10, 2018
Hexadecimal and RGBA alpha values
View hex_rgba_alpha.txt
Opacity % 255 Step 2 digit HEX prefix
0% 0.00 00
5% 12.75 0C
10% 25.50 19
15% 38.25 26
20% 51.00 33
25% 63.75 3F
30% 76.50 4C
35% 89.25 59
40% 102.00 66
@statickidz
statickidz / search_replace.php
Last active Feb 13, 2018
Search and replace files recursive PHP script
View search_replace.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow"/>
<title>Search and replace files</title>
</head>
<body style="margin: 0; padding: 0;">
<?php
$err_arr = array(0 => '', 1 => '');
@statickidz
statickidz / wordpress_database_dump.php
Created Sep 22, 2016
Dump Wordpress database from PHP
View wordpress_database_dump.php
<?php
$wpConfig = $_SERVER['DOCUMENT_ROOT'].'/wp-config.php';
if (file_exists($wpConfig)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($wpConfig));
header('Expires: 0');
header('Cache-Control: must-revalidate');