Skip to content

Instantly share code, notes, and snippets.

View gsdefender's full-sized avatar
💭
I may be slow to respond.

Emanuele Cipolla gsdefender

💭
I may be slow to respond.
View GitHub Profile
@gsdefender
gsdefender / java-properties.php
Created October 27, 2015 15:02 — forked from alecgorge/java-properties.php
Parse Java properties files in PHP
<?php
function parse_properties($txtProperties) {
$result = array();
$lines = split("\n", $txtProperties);
$key = "";
$isWaitingOtherLine = false;
foreach ($lines as $i => $line) {
if (empty($line) || (!$isWaitingOtherLine && strpos($line, "#") === 0))
continue;
@gsdefender
gsdefender / fuck-openldap.sh
Created August 23, 2016 15:56 — forked from jaseg/README.md
Convert openldap .schema files to .ldif files
#!/usr/bin/env bash
# convert OpenLDAP schema file to LDIF file
#
# Copyright 2012 NDE Netzdesign und -entwicklung AG, Hamburg
# Written by Jens-U. Mozdzen <[email protected]>
# Copyright 2014 jaseg <[email protected]>
#
# Permission is granted to use, modify and redistribute this file as long as
# - this copyright notice is left unmodified and included in the final code
@gsdefender
gsdefender / stop_words.php
Last active September 28, 2016 13:00 — forked from brianteachman/stop_words.php
A function that returns a PHP array of common English and Italian stop words.
<?php
//http://www.ranks.nl/stopwords/(language)
function stop_words($lang)
{
$stop_words = array("it_IT" => array("a",
"adesso",
"ai",
"al",
"alla",
"allo",
@gsdefender
gsdefender / QCacheGrind-install.sh
Last active November 4, 2018 21:31 — forked from RichVRed/install.sh
Install QCacheGrind on Ubuntu
#!/bin/bash
# Build against Qt 4
sudo apt-get install qt4-default
# Build against Qt 5
#sudo apt-get install qt5-default
wget http://kcachegrind.sourceforge.net/kcachegrind-0.7.4.tar.gz
tar xvf kcachegrind-0.7.4.tar.gz
cd kcachegrind-0.7.4
# If building against Qt 5, uncomment lines 12-16:
Search for : (.*(\n|$)){2}
alt+R - to toggle regular expression search
alt+ENTER - to select all results
//WooCommerce Email Customizations
add_filter( 'woocommerce_email_recipient_customer_note', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2);
add_filter( 'woocommerce_email_recipient_customer_completed_order', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2);
add_filter( 'woocommerce_email_recipient_customer_invoice', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2);
add_filter( 'woocommerce_email_recipient_customer_processing_order', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2);
/**
* $recipient could be comma separated to send to additional people
* EX. $recipient .= ', $additonal_recipient';
*/