Skip to content

Instantly share code, notes, and snippets.

David Perez davidperezgar

Block or report user

Report or block davidperezgar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidperezgar
davidperezgar / clean-node-modules.sh
Created Aug 3, 2019
Clean Node modules folders
View clean-node-modules.sh
find . -name "node_modules" -exec rm -rf '{}' +
@davidperezgar
davidperezgar / htaccess.txt
Created May 30, 2019
Redirect all domain to new and keep url path
View htaccess.txt
<IfModule mod_rewrite.c>
RewriteEngine On
redirectMatch 301 ^(.*)$ https://www.domain.com$1
</IfModule>
@davidperezgar
davidperezgar / wpcli-updates.sh
Created Apr 23, 2019
WordPress rutine SH to update all Local WordPress
View wpcli-updates.sh
#!/bin/bash
#
#
clear
for d in * ; do
#if [ -e "$d/wp-config.php" ]; then
cd "$d"
echo "-----------------------------"
echo "Updating WordPress in... $d"
wp core update
View script-fb-track.js
<script>fbq('track', 'Lead');</script>
@davidperezgar
davidperezgar / wc-update-weight.php
Created Apr 16, 2019
WooCommerce rutine for update weights products
View wc-update-weight.php
<?php
ini_set( 'memory_limit', '1024M' );
ini_set( 'max_execution_time', 600 );
define( 'WP_USE_THEMES', false );
require_once 'wp-load.php';
echo 'iniciado proceso.' . date( 'H:i:s', time() ) . '<br />';
$weight_final = '1000';
@davidperezgar
davidperezgar / script-fb-pageview.js
Created Apr 9, 2019
Facebook Script Page View for Google Tag Manager
View script-fb-pageview.js
<script>fbq('track', 'PageView');</script>
@davidperezgar
davidperezgar / gist-orders.sh
Created Apr 5, 2019
Site ground Installation for Git
View gist-orders.sh
ssh-keyscan -t rsa itm20.siteground.biz >> ~/.ssh/known_hosts
cd ~/.ssh/
nano [your-private-key]
chmod 600 [your-private-key]
ssh-add -K ~/.ssh/[your-private-key]
# Poner la frase privada que da SG-Git
git clone ssh://[url]
@davidperezgar
davidperezgar / .gitignore
Created Mar 10, 2019
Gitignore recommended for WordPress Site repository
View .gitignore
#Wordpress
htaccess.txt
index.php
licencia.txt
license.txt
readme.html
robots.txt
wp-activate.php
wp-blog-header.php
wp-comments-post.php
@davidperezgar
davidperezgar / git-ftp-config
Last active Mar 6, 2019
GIT FTP Config lines
View git-ftp-config
[git-ftp]
      url = ftp://ftp.url.com:21/www/
      user = username
      password = "pass"
You can’t perform that action at this time.