Skip to content

Instantly share code, notes, and snippets.

View marcinsdance's full-sized avatar

Marcin Dancewicz marcinsdance

View GitHub Profile
@rafaelstz
rafaelstz / Magento2-API-OAuth-based_authentication.php
Last active September 8, 2023 06:15
Sample files to use Magento 2 REST and SOAP API. Using Token-based authentication and OAuth-based authentication method.
<?php
function sign($method, $url, $data, $consumerSecret, $tokenSecret)
{
$url = urlEncodeAsZend($url);
$data = urlEncodeAsZend(http_build_query($data, '', '&'));
$data = implode('&', [$method, $url, $data]);
$secret = implode('&', [$consumerSecret, $tokenSecret]);
@bastianallgeier
bastianallgeier / radius.php
Last active April 19, 2020 18:09
Radius search
<?php
/**
* Simple helper to fetch the bounding boxes
* for a point on the map (lat,lng) by radius.
*
* @param double $lat Latitude
* @param double $lng Longitude
* @param int $radius Radius in km
* @return array
@ajardin
ajardin / categories.sql
Last active April 6, 2018 20:47
How to clean up a Magento database
DELETE cce , cceda , ccede , ccei , ccet , ccev FROM catalog_category_entity cce
LEFT JOIN
catalog_category_entity_datetime AS cceda ON cce.entity_id = cceda.entity_id
LEFT JOIN
catalog_category_entity_decimal AS ccede ON cce.entity_id = ccede.entity_id
LEFT JOIN
catalog_category_entity_int AS ccei ON cce.entity_id = ccei.entity_id
LEFT JOIN
catalog_category_entity_text AS ccet ON cce.entity_id = ccet.entity_id
LEFT JOIN
@jsifalda
jsifalda / php.ini
Created August 18, 2012 10:32
Xdebug: nginx (php-fpm) and phpStorm configuration
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
[xdebug]
xdebug.idekey="macgdbp"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9089
xdebug.remote_handler="dbgp"
@jonathonbyrdziak
jonathonbyrdziak / Instructions
Created October 10, 2011 08:02
The perfect magento installation on CentOS 6
#
# @author Jonathon byrd
#
############################################################
# first things first, set your iptables for a web server. If you jack these
# up you don't want to have to re-install your os after doing much more.
# @see http://www.thegeekstuff.com/2011/06/iptables-rules-examples/
# and
# @see https://help.ubuntu.com/community/IptablesHowTo
@nu7hatch
nu7hatch / example.html
Created September 7, 2010 14:20
Simple banner rotator with jQuery
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<link href="rotate.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="rotate.js"></script>
<script type="text/javascript">
$(window).load(function() {
startRotator("#rotator");
})
</script>