Skip to content

Instantly share code, notes, and snippets.

View standa's full-sized avatar

Standa standa

  • Standa
  • Prague, Czech Republic, Europe
View GitHub Profile
@standa
standa / opencart_catalog_information_get_by_id.php
Last active December 24, 2015 04:59
Get an Information page content by ID set in the Admin Settings page
<?php
// @author standa | 2013-09-28 | get the return terms
// 1. load the model and get the page id
$this->load->model('catalog/information');
// here the page_id is the setting from the Admin / Settings / Default Shop / Options
$page_id = $this->config->get('config_return_id')
// 2. get the the row from the information database
@standa
standa / opencart_controllers_common_footer.php
Created September 28, 2013 23:44
Fill the template data using the database page information texts in Opencart.
@standa
standa / Mandrill.php
Created March 16, 2014 21:05
Mandrill CodeIgniter Library
<?php if (!defined('BASEPATH')) die();
/**
* This is a complete rewrite to use the Mandrill API instead of the
* weird thing that OpenCart people patched up in here.
*
* Inspired by Mindrill
* @link https://github.com/darrenscerri/Mindrill
*
* @author standa
@standa
standa / SendEmail.php
Created March 16, 2014 21:06
Send Email Using CodeIgniter
private function sendEmail() {
$this->load->library('email');
$this->config->load('email');
$tos = explode(',', $this->input->post('emaily'));
// print_r($tos);
if (empty($tos)) {

How to successfully install vendors of Symfony2 on Dreamhost Shared

Sometimes, simply running php composer install or php composer update will throw an error at building bootstrap.php time. To resolve this issue, proceed like this:

First, run:

php composer update --no-scripts
@standa
standa / GetAsinBySku.php
Created April 6, 2014 13:47
Get Amazon ASIN By SKU PHP example
/**
* Get Amazon ASIN by SKU
*
* @param string $sku
* @return string Amazon ASIN
* @link http://docs.developer.amazonservices.com/en_UK/products/Products_GetMatchingProductForId.html
*/
public function getAsinBySku($sku)
{
// append the real SKU ending
@standa
standa / wordpress.php
Created April 16, 2014 08:12
Wordpress SOAP Client
<?php
/**
* download latest posts from the Wordpress blog
* - will only return 3 latest posts with a $tag homepage by default
*
* you will need PHP Curl extension - I'm too lazy to use native php sockets :)
* and also xmlrpc so please:
*
* apt-get install php5-curl php5-xmlrpc
@standa
standa / InsertInputFileDynamically.js
Created April 22, 2014 09:43
Insert input file dynamically using javascript
// works on jQuery 1.9+
$(document).on('change', '.soubor', function () {
if ($(this).val() != '') {
var id = $('.soubor').length + 1;
$('<input>', {type: 'file', name: 'soubor'+id, id: 'soubor'+id, 'class': 'soubor form-control'})
.insertAfter($('.soubor').last());
}
});
@standa
standa / cleanup.sql
Last active October 1, 2015 11:09 — forked from vojtagrec/cleanup.sql
Magento multistore migration sql command
UPDATE customer_entity
SET email=CONCAT(OLD_PASSWORD(email), '@example.com')
WHERE email NOT LIKE '%aardvark%' AND email NOT LIKE '%keyup%' AND email NOT LIKE '%grec.cz';
UPDATE sales_flat_order_address
SET email=CONCAT(OLD_PASSWORD(email), '@example.com');
UPDATE sales_flat_order
SET customer_email=CONCAT(OLD_PASSWORD(customer_email), '@example.com');
UPDATE core_config_data
@standa
standa / designer.html
Created July 20, 2014 14:44
designer
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../chart-js/chart-js.html">
<polymer-element name="my-element">