Skip to content

Instantly share code, notes, and snippets.

View agiannis's full-sized avatar

Alex Giannis agiannis

View GitHub Profile
@agiannis
agiannis / extract-cs-cart-plugin-sh
Last active June 26, 2020 15:28
labels : cs-cart , tools , php , plugin , addon , extract
find . -type f -path *plugin_name* | grep -v ".history/" | zip plugin_name.zip -@
@agiannis
agiannis / upload_changes.bat
Last active June 1, 2023 10:44
label: git
@echo off
REM Upload git changes to ftp with the help of WinSCP
REM USAGE: go to the project root directory and just hit upload_changes.
REM The root directory must have a upload.conf file with winscp_host,remote_path data.
REM "winscp_host" is the name of WinSCP host name.
REM Check WinSCP directory is set correctly
REM Get changes from n latest commits
set latest=%1
REM set winscp_host="testsite.com"
/**
* Remove actions that are assigned to a unknown Class
* @param string $action The action name
* @param string $function_name The method of the Class
*
*/
public function remove_action_with_class($action,$function_name) {
if(!empty($GLOBALS['wp_filter'][$action])) {
foreach ($GLOBALS['wp_filter'][$action] as $position_key=>$position ) {
foreach ($position as $hook_key=>$hook_data) {
set @a=null,@c=null,@b=concat("show tables where",ifnull(concat(" `Tables_in_",database(),"` like '",@c,"' and"),'')," (@a:=concat_ws(',',@a,`Tables_in_",database(),"`))");
Prepare `bd` from @b;
EXECUTE `bd`;
DEALLOCATE PREPARE `bd`;
set @a:=concat('optimize table ',@a);
PREPARE `sql` FROM @a;
EXECUTE `sql`;
DEALLOCATE PREPARE `sql`;
@agiannis
agiannis / hide_email.php
Last active August 7, 2023 08:17
label: wordpress, email , php , shortcode , hide
/**
* Protect an email address from harvesting
* based on http://www.maurits.vdschee.nl/php_hide_email/
*
* @param string $email email address to protect
* @param string $text (optional) The text of the link.
* @param string $extra (optional) Any extra parameters on the <a> tag
* @param string $subject (optional) Subject of the email
* @return string the link
*/
@agiannis
agiannis / git-commands.git
Last active January 7, 2018 23:43
label: git
#get latest changes
git archive -o latest.zip HEAD $(git diff --name-only HEAD HEAD^)