Skip to content

Instantly share code, notes, and snippets.

@pherrymason
pherrymason / tarjetas de prueba.md
Last active January 19, 2024 22:24
Tarjetas de prueba. NO SIRVEN para realizar pagos reales. Sólo los desarrolladores sabrán para que sirven.

##4B (Banco pastor, Banco popular, Banco Santander Cental Hispano…):

  • Nº Tarjeta: 40000 Cualquier fecha de caducidad futura y cvv2: 111
  • Nº Tarjeta: 12345 Cualquier fecha de caducidad futura y cvv2: 111

##CECA (BBK, Kutxa,CajaSur, Caja Granada, Caja de guadalajara…):

  • 5540500001000004 Caducidad: AAAA12 (Diciembre del año en curso) CVV2: 989
  • 5020470001370055 Caducidad: AAAA12 (Diciembre del año en curso) CVV2: 989
  • 5020080001000006 Caducidad: AAAA12 (Diciembre del año en curso) CVV2: 989
@pherrymason
pherrymason / analytics tracking events.js
Created December 10, 2013 09:54
Analytics Tracking
function trackEvent( zone ){
// If ga is available & loaded.
if( typeof(ga)!=='undefined' ){
// https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
// Use universal analytics @todo
}
else
{
var _gaq = window._gaq || []; // For tracking analytics
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
And what about pgettext and npgettext? They are there in the gettext documentation, but there aren't in PHP. They're very useful if you have the same messages for translation, but in different contexts, so they should be translated separately and probably differently.
Fortunately, there is a simple work-around, which may help:
From the gettext.h header one can find out that pgettext() is only a macro calling dcgettext() internally with properly mangled parameters - msgctxt and msgid are glued together with use of ASCII char 4 [EOT, End Of Text]. The same way they're written in .mo files, so it's possible to refer them this way.
Here's my "emulated" pgettext() function:
<?php
if (!function_exists('pgettext')) {
@pherrymason
pherrymason / aws-ec2-redis-cli.md
Created December 13, 2018 08:20 — forked from paladini/aws-ec2-redis-cli.md
AWS redis-cli without redis server on AWS EC2

Setup redis-cli without the whole Redis Server on AWS EC2

This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:

$ sudo yum install gcc

This may return an "already installed" message, but that's OK. After that, just run:

$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli

@pherrymason
pherrymason / Modern Javascript Project.md
Created September 12, 2018 10:31
Modern Javascript Project
LESS CSSNEXT
---------------------------
fade(<color>, 10%) | color(<color> alpha(10%))
@pherrymason
pherrymason / snowflakes.js
Created December 25, 2013 09:37
Snowflakes with javascript & canvas
(function () {
var COUNT = 300;
var masthead = document.querySelector('.masthead');
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var width = masthead.clientWidth;
var height = masthead.clientHeight;
var i = 0;
var active = false;
@pherrymason
pherrymason / unbind.hoverIntent.js
Created April 11, 2014 11:06
Unbind jQuery HoverIntent
var rawIntent = $.fn.hoverIntent;
$.fn.hoverIntent = function(handlerIn, handlerOut, selector){
var args = arguments;
return this.each(function(){
// If called with empty parameter list, disable hoverIntent
if( typeof handlerIn==='undefined' )
{
// Destroy the time if it is present
if( typeof(this.hoverIntent_t!=='undefined') )
#
# Directory aliases
#
alias life="cd /Volumes/Develop/GitRepos/viscaweb/life"
alias wsserver="cd /Volumes/Develop/GitRepos/viscaweb/socket-server"
# php cli + xdebug
alias phpxdebug="php -dxdebug.default_enable=1 -dxdebug.remote_autostart=1 -dxdebug.remote_enable=1 -dxdebug.remote_mode=req"