Skip to content

Instantly share code, notes, and snippets.

Jose Ruzafa jruzafa

View GitHub Profile
echo "deb buster main" | sudo tee /etc/apt/sources.list.d/azlux.list
wget -qO - | sudo apt-key add -
sudo apt-get update
sudo apt-get install bashtop


jruzafa /
Created Oct 8, 2019 — forked from KartikTalwar/
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
jruzafa /
Created Oct 8, 2019 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

View google_spreadsheet_double_quotes_formula.txt
Export spreadsheet as csv.
Open with sublime;
1.Replace """" with ""
2.Replace """ with "

Debugging (Resource) Model Instantiation

Follow each step manually and any bugs during (resource) model instantiation will become obvious.

Since many people find model and resource model instantiation to be one of the more challenging things in Magento 1, these are all the steps Magento does to resolve the factory name to the real PHP class name.

To debug, simply follow each step manually until you find a non-match. This works really well in my experience.
Less guessing, more and faster results.

In the examples I use a factory name of "example/thing".

jruzafa / php_snippets.php
Last active Mar 13, 2019
Php snippets #php #snippets
View php_snippets.php
$csv = array_map('str_getcsv', file($file));
array_walk($csv, function(&$a) use ($csv) {
$a = array_combine($csv[0], $a);
array_shift($csv); # remove column header
// Format price
You can’t perform that action at this time.