Skip to content

Instantly share code, notes, and snippets.

View mehdichaouch's full-sized avatar
🤖
Happiness Developer

Mehdi Chaouch mehdichaouch

🤖
Happiness Developer
View GitHub Profile
@tkhduracell
tkhduracell / README.md
Last active January 2, 2019 05:34
Configure Google Hangout notifications on Jenkins

Install plugins

  • instant-messaging plugin
  • Jabber Plugin plugin

Jenkins > Manage Jenkins > Configure System > Jabber Notification

  • Enable Jabber Notification
  • Jabber ID: <[email protected]>
  • Password: <your password>
  • Advanced
  • Server: talk.google.com
@schmich
schmich / git-repo-mirror.md
Created October 8, 2014 02:31
Mirroring a repo to BitBucket
@zpetr
zpetr / .gitignore
Last active May 9, 2023 00:31 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
#!/bin/bash
### System Setup ###
DIRS="/var/www/shop/public_html"
BACKUP=/tmp/backup.$$
NOW=$(date +"%d-%m-%Y")
DELDATE=$(date -d "-7 days" +"%d-%m-%Y")
### MySQL Setup ###
MUSER="xxx"
@antoinekociuba
antoinekociuba / shopping_cart_sales_rule_with_coupon.php
Last active September 16, 2023 11:00
Magento - Create shopping cart price rule with a specific coupon code programmatically.
<?php
/**
* Create Shopping Cart Sales Rule with Specific Coupon Code Programmatically
*/
// All customer group ids
$customerGroupIds = Mage::getModel('customer/group')->getCollection()->getAllIds();
// SalesRule Rule model
$rule = Mage::getModel('salesrule/rule');
@michelbrito
michelbrito / gist:409f7c02196ecd1ed4ea
Created July 22, 2014 19:30
Magento count() vs getSize()
<?php
/*
O COUNT() primeiro carrega toda a collection e depois conta quantos itens tem. Por isso dependendo da situação, não é melhor opção a se usar para saber se tem registros.
Arquivo: lib/Varien/Data/Collection.php
public function count()
{
$this->load();
return count($this->_items);
}
#!/bin/sh
if [ x = x${2} ]; then
BRANCH_NAME=$(git symbolic-ref --short HEAD)
STORY_NUMBER=$(echo $BRANCH_NAME | sed -n 's/.*-\([0-9]\)/\1/p')
if [ x != x${STORY_NUMBER} ]; then
sed -i.back "1s/^/\n\n[#$STORY_NUMBER]/" "$1"
fi
fi
@danieledangeli
danieledangeli / Clone Entity
Created July 15, 2014 11:30
Clone a doctrine entity
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Inflector\Inflector;
use Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\MappingException;
use Doctrine\ORM\PersistentCollection;
use Foodity\CoreBundle\Helper\EntityHelper;
@staltz
staltz / introrx.md
Last active April 29, 2025 08:33
The introduction to Reactive Programming you've been missing
@ekristen
ekristen / check_docker_container.sh
Last active November 13, 2024 18:11
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: [email protected]
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not