Skip to content

Instantly share code, notes, and snippets.

View cezarpopa's full-sized avatar
:bowtie:

Cezar Popa cezarpopa

:bowtie:
View GitHub Profile
@cezarpopa
cezarpopa / gist:5775c390a0bca0a259e382d2bed396ce
Created May 20, 2017 09:39
Debian Stretch w3af deb packages
http://ftp.uk.debian.org/debian/pool/main/p/pywebkitgtk/
http://ftp.uk.debian.org/debian/pool/main/p/pygtksourceview/
@cezarpopa
cezarpopa / zzzz_custom.ini
Created May 13, 2017 11:11
Vagrant xdebug settings - no extra plugins
[XDEBUG]
zend_extension=xdebug.so
xdebug.default_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=10000
@cezarpopa
cezarpopa / autoplay multiple youtube vimeo videos on hover
Last active January 20, 2025 09:59
autoplay multiple youtube / vimeo videos on hover
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
</head>
@cezarpopa
cezarpopa / WordPress.xml
Created September 30, 2016 09:01 — forked from Rarst/WordPress.xml
WordPress Live Templates for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="WordPress">
<template name="aa" value="add_action( '$hook$', '$callback$' );&#10;$END$" description="add_action" toReformat="false" toShortenFQNames="true">
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
@cezarpopa
cezarpopa / add datagrip to favs
Created September 23, 2016 08:17
datagrip shortcut icon / favorite
sudo nano /usr/share/applications/datagrip.desktop
//
[Desktop Entry]
Version=1.0
Name=DataGrip
Exec=/opt/datagrip/bin/datagrip.sh
Terminal=false
Type=Application
StartupNotify=true
Categories=Application;Development;
@cezarpopa
cezarpopa / gist:d9ab16e34339fd955e4b261c8e03d191
Created May 25, 2016 18:03
WooCommerce empty sku check
SELECT p.ID,
p.post_title,
p.post_type,
pm.meta_value
FROM wp_posts p
LEFT JOIN wp_postmeta pm
ON pm.post_id = p.ID
AND pm.meta_key = '_sku'
WHERE p.post_type = 'product'
AND (pm.meta_value = ''
@cezarpopa
cezarpopa / woocommerce_mysql
Created May 3, 2016 18:18
Woocommerce to MailPoet userinfo import
UPDATE (
SELECT
u.ID as ID,
u.user_email as email,
max( CASE WHEN um.meta_key = 'billing_first_name' and u.ID = um.user_id THEN um.meta_value END ) as billing_first_name,
max( CASE WHEN um.meta_key = 'billing_last_name' and u.ID = um.user_id THEN um.meta_value END ) as billing_last_name,
max( CASE WHEN um.meta_key = 'billing_address_1' and u.ID = um.user_id THEN um.meta_value END ) as billing_address_1
FROM awp_users as u
INNER JOIN
@cezarpopa
cezarpopa / gist:1a13254ae69781c64884
Created March 8, 2016 10:28
View screen size / viewport
<script type="text/javascript">
document.write(screen.width+'x'+screen.height);
</script>
@cezarpopa
cezarpopa / csv.php
Created January 16, 2016 09:18 — forked from lordspace/csv.php
a class to read and write CSV
<?php
/**
* This class is used in Orbisius Price Changer for WooCommerce
* This premium WooCommerce extension allows you to change product prices (up/down) for all products or for a selected category and its subcategories.
* You can review them before actually making the changes.
*
* @see http://club.orbisius.com/products/wordpress-plugins/woocommerce-extensions/orbisius-woocommerce-ext-price-changer/
* @author jaywilliams | myd3.com | https://gist.github.com/jaywilliams
* @author Svetoslav Marinov (SLAVI) | http://orbisius.com
@cezarpopa
cezarpopa / add_url_to_body
Last active November 14, 2015 12:49
add url / slug from page/pages to body WordPress
/**
* Adds custom classes to the array of body classes.
* Based @Underscores.me
* @param array $classes Classes for the body element.
* @return array
*/
function ks_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author.
if ( is_multi_author() ) {
$classes[] = 'group-blog';