Skip to content

Instantly share code, notes, and snippets.

View iPublicis's full-sized avatar

Lopo iPublicis

View GitHub Profile
@iPublicis
iPublicis / malware-removal.sh
Created November 4, 2024 00:28 — forked from ThakurGumansingh/malware-removal.sh
This script will check for any htaccess present in wp folders and if exists, it will rename it and will create a new htaccess in root_dir with default rules and downloads core files.
#!/bin/bash
# Function to search and rename .htaccess files
search_and_rename_htaccess() {
local dir="$1"
if [ -f "$dir/.htaccess" ]; then
echo "Found .htaccess in $dir"
mv "$dir/.htaccess" "$dir/.htaccess-bak"
echo "Renamed to $dir/.htaccess-bak"
fi
@iPublicis
iPublicis / emergency.php
Last active July 16, 2024 11:33 — forked from eduardopintor/emergency.php
Emergency Password Reset Script
<?php
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@iPublicis
iPublicis / git-unmerged
Created May 29, 2020 19:05 — forked from agnoster/git-unmerged
Check to see if which commits are not shared between two branches
#!/bin/bash
BRANCH1=${1:-master}
BRANCH2=${2:-HEAD}
echo; echo "Only in $BRANCH1"
git cherry -v $BRANCH2 $BRANCH1
echo; echo "Only in $BRANCH2"
git cherry -v $BRANCH1 $BRANCH2
@iPublicis
iPublicis / README.md
Created May 1, 2020 15:27 — forked from kostasx/README.md
Using TensorFlow.js with MobileNet models for image classification on Node.js

USAGE:

$ node mobilenet-node.js ./model image.jpg

@iPublicis
iPublicis / delete-feature.sh
Created April 17, 2020 22:33 — forked from chrisjlee/delete-feature.sh
Delete branch with prefix
git branch -D `git branch | grep 'feature/*'`
@iPublicis
iPublicis / delete-feature-branches.sh
Created April 17, 2020 22:33 — forked from chrisjlee/delete-feature-branches.sh
Delete feature branch with prefix locally then remove all remote feature branches
# Stole from:
# http://stackoverflow.com/questions/32122784/alias-script-to-delete-all-local-and-remote-git-branches-with-a-specific-prefix
git branch -D $(printf "%s\n" $(git branch) | grep 'feature/')
# Or this will work too to remove all remote branches:
# https://coderwall.com/p/eis0ba/remove-a-thousand-stale-remote-branches-on-git
git branch -r | awk -F/ '/\/feature/{print $2}' | xargs -I {} git push origin :{}
# Prune all origin branches
git remote prune origin
@iPublicis
iPublicis / app.scss
Created April 17, 2020 22:31 — forked from chrisjlee/app.scss
fix the bootstrap / webpack asset import issue
// https://github.com/webpack-contrib/sass-loader/issues/40
$bootstrap-sass-asset-helper: true;
@import "~bootstrap-sass/assets/stylesheets/bootstrap";
@iPublicis
iPublicis / woocommerce_catalog_mode.php
Created April 10, 2019 11:52 — forked from webdados/woocommerce_catalog_mode.php
WooCommerce easy "Catalog mode" - Disable all products from being purchasable
<?php
// Disable all products from being purchasable (Yes, that's it...) - Add this to your (child) theme functions.php file
add_filter( 'woocommerce_is_purchasable', '__return_false' );
@iPublicis
iPublicis / .htaccess
Created January 31, 2019 17:21 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]