Skip to content

Instantly share code, notes, and snippets.

Trajche Kralev trajche

Block or report user

Report or block trajche

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
trajche / headerparser.php
Last active Nov 5, 2019
link rel parser for headers in shopify / github
View headerparser.php
function returnHeaderArray($linkHeader) {
$cleanArray = [];
if (strpos($linkHeader, ',') !== false) {
//Split into two or more elements by comma
$linkHeaderArr = explode(',', $linkHeader);
} else {
//Create array with one element
$linkHeaderArr[] = $linkHeader;
trajche / delete-all-products.php
Last active Jul 2, 2019 — forked from mikaelz/delete-all-woocommerce-products.php
Remove all WooCommerce products from database via SQL
View delete-all-products.php
require dirname(__FILE__).'/wp-blog-header.php';
//Removing attributes (does not work for some reason, should read up on
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id NOT IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
//Removing products and product variations
trajche / multiple-select-woocommerce.php
Created Mar 7, 2018
WooCommerce Product multiple select options
View multiple-select-woocommerce.php
function woocommerce_wp_select_multiple( $field ) {
global $thepostid, $post, $woocommerce;
$thepostid = empty( $thepostid ) ? $post->ID : $thepostid;
$field['class'] = isset( $field['class'] ) ? $field['class'] : 'select short';
$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';
$field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id'];
$field['value'] = isset( $field['value'] ) ? $field['value'] : ( get_post_meta( $thepostid, $field['id'], true ) ? get_post_meta( $thepostid, $field['id'], true ) : array() );
trajche / countries.html
Created Jan 20, 2017
salesforce country list
View countries.html
<select id="con18country" name="con18country" tabindex="26">
<option value="">
<option value="AF">
<option value="AX">
Aland Islands
trajche / woocomerce_clean
Last active May 15, 2018 — forked from ScottDeLuzio/mysql_query
MySQL query remove Woocommerce sessions & transients
View woocomerce_clean
DELETE FROM wp_options WHERE option_name LIKE '_wc_session_%' OR option_name LIKE '_wc_session_expires_%';
DELETE FROM wp_options WHERE option_name LIKE '_transient_wc_%' OR option_name LIKE '_transient_timeout_wc_%';
trajche / sources.list
Created Dec 15, 2015
Adding Proxmox repository for Debian 8.2 Jessie
View sources.list
deb jessie main contrib non-free
deb jessie main contrib non-free
deb jessie-updates main contrib non-free
deb jessie pve-no-subscription
deb jessie/updates main contrib non-free
trajche / WordPress Custom Global
Created Oct 27, 2015 — forked from aahan/WordPress Custom Global
Creating and using custom global variables in wordpress.
View WordPress Custom Global

First create global variables (in functions.php or as a mu-plugin):


function wtnerd_global_vars() {
trajche / delete_user_select_inheritance.js
Created Oct 19, 2015
Select new author to inherit posts, when deleting user from website
View delete_user_select_inheritance.js
jQuery( "input#delete_option1" ).each(function() {
jQuery( this ).attr("checked","checked");
jQuery( "select#reassign_user" ).each(function() {
jQuery( this ).val("81");
trajche / pptx_progress_bar.vba
Last active Oct 19, 2015
Progress bar for a Powerpoint in VBA
View pptx_progress_bar.vba
Sub ProgressBar()
On Error Resume Next
With ActivePresentation
For X = 1 To .Slides.Count
Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
0, 0, _
X * .PageSetup.SlideWidth / .Slides.Count, 18)
s.Fill.ForeColor.RGB = RGB(63, 153, 209)
s.Line.Visible = 0
trajche / index.html
Last active Sep 8, 2015
HTML5 Boilerplate
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="" name="description">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link href=""rel="stylesheet">
You can’t perform that action at this time.