This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyCompany_MyModul_Model_Observer | |
{ | |
/** | |
* | |
* | |
*/ | |
public function addDisableValidatFromKey(Varien_Event_Observer $observer) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function csv2objArr(data, strip, callback){ | |
(strip instanceof Function) ? (callback = strip, strip = 0) : (strip = strip || 0); //Did the user specify strip? | |
data = data.split('\n' || '\r'); | |
if(strip){ | |
for(var elem in data){//loop to convert "val, val, val" to ["val", " val", " val"] | |
var tmpArr = data[elem].split(','); | |
for(var tmpElem in tmpArr){//loop to convert ["val", " val", " val"] to ["val", "val", "val"] | |
tmpArr[tmpElem] = tmpArr[tmpElem].trim(); | |
} | |
data[elem] = tmpArr.join(); //convert ["val", "val", "val"] to "val,val,val" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
File prepared by Matt Weinberg, www.vectormediagroup.com and www.cartthrob.com | |
EXPLANATION: | |
In 2018, PayPal will be updating their Live/Production environment. | |
Many servers, especially older ones, will not be able to connect to PayPal after the settings are changed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* yeah i know, php buuuuuh */ | |
exec('apt-cache dumpavail | grep "Package:" | awk \'{print $2}\' > packages.txt'); | |
exec('dpkg -l | awk \'{print $2}\' > installed.txt'); | |
$packages = file_get_contents('packages.txt'); | |
$packages = str_replace("\r", '', $packages); | |
$packages = array_filter((array) explode("\n", $packages)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Written on Debian Based Systems | |
usage: mysql_[import|export].sh DATABASENAME | |
Splits Database in to multplie files, based on Table Names | |
schema.sql will be also created! | |
i've an my_import.cnf / my_export.cnf or exists, this files will be used as Credentails, default is the debian default file. | |
Files: schema.sql, routines_triggers.sql |