Skip to content

Instantly share code, notes, and snippets.

View sylvainraye's full-sized avatar

Sylvain Rayé sylvainraye

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sylvainraye on github.
  • I am sylvainraye (https://keybase.io/sylvainraye) on keybase.
  • I have a public key ASA3I9U_G6RXB9iv4F-P9LRZTNnUK0vaob-oWfETtSltcAo

To claim this, I am signing this object:

#!groovy
import groovy.json.JsonOutput
import java.util.Optional
import hudson.tasks.test.AbstractTestResultAction
import hudson.model.Actionable
import hudson.tasks.junit.CaseResult
def speedUp = '--configure-on-demand --daemon --parallel'
def nebulaReleaseScope = (env.GIT_BRANCH == 'origin/master') ? '' : "-Prelease.scope=patch"
@sylvainraye
sylvainraye / Authentication.php
Last active April 13, 2017 08:33
WSSE Authentification for OroPlatform REST API
<?php
/**
* Diglin GmbH - Switzerland
*
* User: sylvainraye
* Date: 22.03.14
* Time: 17:11
*
* @category orocrm
* @package Diglin_Oro
@sylvainraye
sylvainraye / index.php
Created November 26, 2016 21:59
XHProf for index.php for Magento 1.x
<?php
/**
* Magento Enterprise Edition
*
* NOTICE OF LICENSE
*
* This source file is subject to the Magento Enterprise Edition End User License Agreement
* that is bundled with this package in the file LICENSE_EE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.magento.com/license/enterprise-edition
<?php
namespace Linkofy\CommonBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class Builder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@sylvainraye
sylvainraye / SoapClient.php
Created October 17, 2013 11:23
SOAP Client debugging with Zend Debugger
<?php
/**
* Class based on the blog article of Maxune.com
*
* @category Diglin
* @package Diglin_Debug
* @copyright Copyright (c) 2013 Diglin GmbH - Switzerland
* @license none
* @version 1.0.0
* @link http://moxune.com/blog/2011/09/debug-soap-server-zend-studio/
@sylvainraye
sylvainraye / searchandreplace
Created October 2, 2013 07:50
Search and replace SQL Query
UPDATE Table SET champ=REPLACE(champ,'chaine 1','chaine 2') WHERE champ LIKE '%chaine 1%'
<?php
class EcomDev_Optimization_Model_Resource_Attribute_Source_Table extends Mage_Eav_Model_Entity_Attribute_Source_Table
{
protected static $_preloadedOptions = array();
protected static function _getStoreOptions($storeId, $attributeId)
{
if (!isset(self::$_preloadedOptions[$storeId])) {
$options = Mage::getResourceModel('eav/entity_attribute_option_collection')
@sylvainraye
sylvainraye / countlinesofcode.sh
Created September 13, 2013 12:38
Count the number of coded lines
find . -type f -name '*.php' -exec awk 'END {print NR}' '{}' + 2>/dev/null | awk '{ total+=$1 }END{print total}'
@sylvainraye
sylvainraye / diffandcopy.sh
Last active December 22, 2015 23:58
Awk command for diff and copy file
# do an echo only of the result
diff -x "CVS" -x '.svn*' -bqr originaux/magento17/include/ myproject/include/ | grep "Only in originaux" | awk '{gsub(":", "", $3); filesource=$3"/"$4; print filesource; gsub("originaux/magento17/", "myproject/", $3); filetarget=$3"/"$4; print filesource" - "filetarget; }'
# do the copy
diff -x "CVS" -x '.svn*' -bqr originaux/magento17/include/ myproject/include/ | grep "Only in originaux" | awk '{gsub(":", "", $3); filesource=$3"/"$4; print filesource; gsub("originaux/magento17/", "myproject/", $3); filetarget=$3"/"$4; system ("cp -R "filesource" "filetarget); }'