Skip to content

Instantly share code, notes, and snippets.

mklooss / 1_database_export_import_readme.txt
Last active May 11, 2022
Export MySQL/MariaDB Database in Tables
View 1_database_export_import_readme.txt
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!
Files: schema.sql
mklooss / find-old-debian-packages.php
Last active Mar 14, 2017
find old debian packages after upgrade
View find-old-debian-packages.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));
mrw / paypal_cert_test.php
Last active Apr 9, 2018
PHP PayPal new certificate test
View paypal_cert_test.php
File prepared by Matt Weinberg, and
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.
xandout / csvToObjArr.js
Last active Aug 29, 2015
JavaScript CSV to Array of Objects
View csvToObjArr.js
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');
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"
mklooss / Observer.php
Created Nov 13, 2013
Magento form_key validation failed in 1.8 after upgrade from 1.7
View Observer.php
class MyCompany_MyModul_Model_Observer
public function addDisableValidatFromKey(Varien_Event_Observer $observer)