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
@JamesPaden
JamesPaden / gist:7a020357e533f4ab31cd
Created September 3, 2015 11:53
Apache Config for Wordpress Reverse Proxy
# Put this inside the <VirtualHost> directive
<Location /blog>
RequestHeader set X-Is-Reverse=Proxy true
RequestHeader set X-Original-Host yourwebsite.com
ProxyPass http://yourpressableblog.com
ProxyPassReverse http://yourpressableblog.com
</Location>
@markshust
markshust / data-install-0.0.0.1.php
Created July 9, 2015 12:39
update magento static block programmatically through upgrade scripts
<?php
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$connection = $installer->getConnection();
$identifier = 'id-goes-here';
$title = 'Title Goes Here';
@rmatil
rmatil / gist:4bc690f3884638c427c9
Last active October 27, 2018 03:00
Puphpet, Vagrant, PHPStorm and Xdebug

Setup Xdebug for PHPStorm on vagrant using PHP

Create Virtual Machine

Go to PUPHPET and create your VM. Check Install Xdebug on step 4 (Languages > PHP).

Configure Xdebug on the VM

First check that everything went right while provisioning your VM: Create a new file named info.php and put the following code in it:

#/usr/bin/php
@rtrouton
rtrouton / gist:11bc3f21f47e1a79d099
Last active April 9, 2020 23:03
Downloading the latest release of a project from GitHub
#!/bin/bash
# How to set these variables:
#
# GitHub_Owner
# GitHub_Repo
#
# Example use:
#
# The Linde Group has repos on GitHub available
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active May 25, 2024 20:19
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active November 16, 2023 15:11
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@slashfan
slashfan / ImageExtractor.php
Created March 11, 2015 08:40
Basic ImageExtractor PHP Class - Extract first page of a PDF file to an image (jpg or png) using Imagick PHP extension
<?php
namespace Acme\Util;
/**
* ImageExtractor
*/
class ImageExtractor
{
const FORMAT_JPG = 'jpg';
@chadrien
chadrien / install.sh
Last active March 19, 2019 00:50
Install mailcatcher on AlwaysData
#!/bin/bash
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
rbenv install 1.9.3-p551
rbenv global 1.9.3-p551
gem install --no-ri --no-rdoc mailcatcher -v0.5.12
rbenv rehash
@rushimusmaximus
rushimusmaximus / gmailToSlack.js
Last active March 2, 2024 13:00
Google Apps Script to post filtered Gmail messages to Slack
/*
The intent of this script is for posting filtered Gmail messages to Slack.
This script could be used on its own with manually-marked messages, but it
is most useful it when combined with a Gmail filter. The script assumes that
target messages have had a specific label set on them and have been starred.
The Apps Script can then be set to run periodically.
2015/02 cmyers, rush
@omurphy27
omurphy27 / Google My Maps Embed Change Zoom Level .html
Created February 18, 2015 19:03
Google My Maps Embed - Change Zoom Level
// Google Maps change zoom level
// just append &amp;z=15 at the end of src url
<iframe src="https://www.google.com/maps/d/embed?mid=zFZSXubrjIbQ.kTtvWjBE06QI&amp;z=15" width="640" height="480"></iframe>