Skip to content

Instantly share code, notes, and snippets.

Avatar

Devert.net DevertNet

View GitHub Profile
@mklooss
mklooss / 1_database_export_import_readme.txt
Last active Feb 23, 2018
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
export/*.sql
@mklooss
mklooss / find-old-debian-packages.php
Last active Mar 14, 2017
find old debian packages after upgrade
View find-old-debian-packages.php
<?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
mrw / paypal_cert_test.php
Last active Apr 9, 2018
PHP PayPal new certificate test
View paypal_cert_test.php
<?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.
@xandout
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');
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"
@mklooss
mklooss / Observer.php
Created Nov 13, 2013
Magento form_key validation failed in 1.8 after upgrade from 1.7
View Observer.php
<?php
class MyCompany_MyModul_Model_Observer
{
/**
*
*
*/
public function addDisableValidatFromKey(Varien_Event_Observer $observer)
{
You can’t perform that action at this time.