Skip to content

Instantly share code, notes, and snippets.

View alecbedzir's full-sized avatar

Alec Bedzir alecbedzir

View GitHub Profile
{
"base_currency_code": "SAR",
"base_discount_amount": 0,
"base_grand_total": 30,
"base_discount_tax_compensation_amount": 0,
"base_shipping_amount": 0,
"base_shipping_discount_amount": 0,
"base_shipping_discount_tax_compensation_amnt": 0,
"base_shipping_incl_tax": 0,
"base_shipping_tax_amount": 0,
@alecbedzir
alecbedzir / scp-speed-test.sh
Last active January 1, 2025 23:31 — forked from mohanraj-r/scp-speed-test.sh
[speed test] Test ssh connection speed
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
# http://www.alecjacobson.com/weblog/?p=635
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in kBs]
@alecbedzir
alecbedzir / magento_caching_models.php
Last active December 24, 2015 15:59
Caching models in magento (possible way). ----- Model after being grabbed from cache is read-only. ----- Note, that once being cached, model is not updated any more in the cache (only if cache is flushed), so even if in DB data is updated - application will still use old data from model cache. ----- Possible improvements: (1) use getSingleton in…
<?php
const LOAD_CACHED_MODEL_KEY_PREFIX = 'cached_model';
/* Usage: */
$specificCmsBlock = Mage::helper('customization')->loadCachedReadOnlyModel('cmsBlockId', 'cms/block');
/**
* Caching model in Magento.
* After being fetched from cache model is supposed to be read-only
* Not tested yet what happens if save() is triggered on model after is is gotten from cache
@alecbedzir
alecbedzir / stats.php
Last active January 1, 2025 23:31
Create nice-looking charts showing CPU usage
<?php
/**
* Script for getting statistics information from server
* To view the content in json _GET parameter "show" should be specified
* To view the content in pretty format _GET parameter/value "show=pretty" should be specified
*/
/**
* Error reporting
*/