Skip to content

Instantly share code, notes, and snippets.

@eamexicano
eamexicano / clip-checkout-fix-aspero-bug.css
Created December 1, 2022 23:26
Corrección para visualizar el logo de Clip Checkout que se ocultó con el tema Aspero
/*
Corrección para visualizar el logo de Clip Checkout que se ocultó con el tema Aspero
https://github.com/eamexicano/clip-payment-gateway
https://themeforest.net/item/aspero-business-wordpress-theme/22226666
*/
li.payment_method_clip_payment_gateway label {
width: 100%;
}
@eamexicano
eamexicano / demo.sql
Created May 15, 2020 05:31
Referencia
CREATE DATABASE `demo` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `demo`;
# Dump of table categorias
# ------------------------------------------------------------
DROP TABLE IF EXISTS `categorias`;
CREATE TABLE `categorias` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
@eamexicano
eamexicano / json.js
Created December 4, 2012 04:25
Referencia básica de JSON
/*
*
* Teclear el código en una consola de JS (en un navegador)
* Los comentarios de una línea (//) son conceptos
* Los comentarios de una línea + flecha sencilla (//->) es código que se puede teclear en la consola.
* Los comentarios de una línea + flecha doble (// => ) es la respuesta que se obtiene.
*
* Copyright (c) 2012 Emmanuel Ayala Mexicano
*/
<!DOCTYPE html
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<?php
// Abrir conexión
$conexion = new mysqli("localhost", "root", "", "tutoriales");
@eamexicano
eamexicano / setup-single.sh
Created September 24, 2012 15:09
Inicializa repositorio de git. Lo envia vía ssh a un nuevo repositorio vacío y sincroniza con htdocs. Necesita el nombre del repo, usuario y modificar las rutas.
#!/bin/bash
SITIO="$1"
USUARIO="$2"
PUERTO="22"
REPOSITORIO_REMOTO="/var/repo/$SITIO"
SHEBANG="#!/bin/bash"
SITIO_HTDOCS="/var/www/$SITIO"
read -r -d '' HOOK <<EOF
${SHEBANG}
@eamexicano
eamexicano / wget.sh
Created May 14, 2016 01:22
Copiar un directorio de manera recursiva con wget
wget -r --user="user@example.com" --password="password" ftp://domain.tld/
@eamexicano
eamexicano / mysql2xls.php
Last active March 2, 2016 19:03
Exporta los datos de MySQL a XLS incluyendo el nombre de los campos
<?php
/**
* The MIT License (MIT)
* Copyright (c) 2016 Emmanuel Ayala Mexicano @eamexicano
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@eamexicano
eamexicano / concatenate.sh
Created November 22, 2013 05:57
Remove carriage return from windows file and create new file. Exclude some files (from a directory) and concatenate into a one big file.
#!/bin/bash
# Remove carriage return from windows file <CR> and createa a new file
tr -d '\015' < windows_file > another_file
# Exclude some files prior concatenation
ls | sort | grep -v -E "(file1|file2|...|fileN)" | xargs cat > large_file
@eamexicano
eamexicano / template.css
Created November 7, 2013 16:39
CSS rules for template.html - To be used as a remote repository.
body { background: #f2f2f2; margin: 0 auto; font-family: 'helvetica neue', helvetica, sans-serif; font-size: 1em; padding: 1em; color: #151515;}
h1, h2, h3, h4, h5, h6 {font-family: georgia, "times new roman", times, serif;}
header {text-align: left;}
section { }
footer {text-align: right; margin: 1em 0;}
@eamexicano
eamexicano / template.html
Created November 7, 2013 16:37
HTML5 base template - to be used as a remote repository.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Template</title>
<link rel="stylesheet" href="template.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<header>
<h1>Template</h1>