Skip to content

Instantly share code, notes, and snippets.

View rubensaid's full-sized avatar

Ruben Felix rubensaid

View GitHub Profile
@claudiosanches
claudiosanches / test.php
Last active February 22, 2024 19:39
Regex for test credit card brand
<?php
// Test cards
$cards = array(
'378282246310005', // American Express
'371449635398431', // American Express
'5078601870000127985', // Aura
'5078601800003247449', // Aura
'30569309025904', // Diners Club
'38520000023237', // Diners Club
@mpampols
mpampols / Cart.php
Created September 11, 2014 20:37
Prestashop: Calculate the shipping cost by grouping products by supplier
<?php
/**
* Return package shipping cost
*
* @param integer $id_carrier Carrier ID (default : current carrier)
* @param booleal $use_tax
* @param Country $default_country
* @param Array $product_list
* @param array $product_list List of product concerned by the shipping. If null, all the product of the cart are used to calculate the shipping cost
@juanghurtado
juanghurtado / practical-git.md
Last active June 30, 2022 09:54
Git práctico

Git práctico

Conceptos clave

Antes de empezar a soltar comandos como un bellaco, hay que explicar los conceptos clave que se necesitan conocer para trabajar con Git.

Comenzaremos con los diferentes estadios en los que puede encontrarse nuestro código (nuestros cambios sobre el contenido de los ficheros, en realidad).

  1. Workspace: Es el estado real de nuestros ficheros. Tal y como los vemos en nuestro editor.
  2. Stage: Aquí se encuentran los cambios sobre nuestros ficheros que se incluirán en el próximo commit. Cuando hacemos un git add, un git rm o un git mv, estamos introduciendo cambios en el stage, indicándole a Git que en el próximo commit esos cambios irán incluidos.
@kpodemski
kpodemski / Link.php
Last active April 29, 2016 18:15
PrestaShop rollover images solution
@oozman
oozman / custom-domain-localhost-xampp
Last active September 1, 2022 06:07
How to add a custom domain name on your localhost using XAMPP. Codes are based on Windows, but Step 2 onwards are pretty much applicable on other operating system.
Step 1:
Go to: C:\Windows\System32\Drivers\etc\hosts
And add this to the bottom of the file:
=============
127.0.0.1 your.domain.com
=============
Step 2:
Go to [your XAMPP directory]/apache/conf/httpd-xampp.conf
@crofty
crofty / leaflet-google.js
Created March 25, 2012 15:07
Leaflet plugin that enables the use of Google Map tiles - http://matchingnotes.com/using-google-map-tiles-with-leaflet
/*
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,