Skip to content

Instantly share code, notes, and snippets.

View heckctor's full-sized avatar

Hektor Peña heckctor

View GitHub Profile
@heckctor
heckctor / if_else_lang.php
Created October 25, 2018 03:06 — forked from beovulf/if_else_lang.php
If else language wordpress (polylang)
<?php
$currentlang = get_bloginfo('language');
if($currentlang=="en-GB"):
?>
<?php elseif($currentlang=="pl-PL"): ?>
<?php endif; ?>
@heckctor
heckctor / hosts
Created March 6, 2018 17:50
Host para bloquear anuncios en spotify
127.0.0.1 media-match.com
127.0.0.1 adclick.g.doublecklick.net
127.0.0.1 open.spotify.com
127.0.0.1 desktop.spotify.com
127.0.0.1 pubads.g.doubleclick.net
127.0.0.1 audio2.spotify.com
127.0.0.1 www.omaze.com
127.0.0.1 omaze.com
127.0.0.1 bounceexchange.com
127.0.0.1 media-match.com
@heckctor
heckctor / buscar_var_url.php
Created January 26, 2018 05:22
Busca el valor en la variable de la URL
<?php
if (htmlspecialchars($_GET["lang"]) == 'en')
{
echo '
<div class="subFooter">Hand Med 2018 | <a href="./notice-of-privacy/?lang=en" >Notice of Privacy</a> </div>
';
}else
{
echo '
<div class="subFooter">Hand Med 2018 | <a href="./aviso-de-privacidad" >Aviso de Privacidad</a> </div>
@heckctor
heckctor / bulmatoscss_gulpfile.js
Created October 10, 2017 00:41 — forked from kritollm/bulmatoscss_gulpfile.js
Converts Bulma CSS framework from SASS to SCSS
// Bulma to scss gulp script
// In your terminal
// 1. npm install -D sass-convert gulp bulma gulp-sass gulp-replace
// 2. gem install sass
var gulp = require("gulp"),
replace = require('gulp-replace'),
converter = require('sass-convert'),
sass = require('gulp-sass');
@heckctor
heckctor / orientacion.js
Created March 24, 2017 16:33
detectar cambio de orientación con javascript
window.addEventListener("orientationchange", function() {
console.log("the orientation of the device is now " + screen.orientation.angle);
});
window.addEventListener("orientationchange", function() {
if (window.orientation == 90 || window.orientation == -90) {
console.log('landscape mode');
} else {
console.log('portrait mode');
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@heckctor
heckctor / gist:485c2e2392de100d71f4c4ae254a19fc
Created January 12, 2017 17:41 — forked from sjimenez77/gist:4419379
jQuery: Validación y llamada AJAX para enviar un correo
/* Validación y llamada AJAX para enviar el correo */
$(".boton_envio").click(function() {
var nombre = $(".nombre").val();
email = $(".email").val();
validacion_email = /^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/;
asunto = $(".asunto").val();
mensaje = $(".mensaje").val();
if ((nombre == "") || (nombre == $(".nombre").attr('placeholder'))){
<ul class="tabs">
<li><a href="#tab-1">Tab1</a></li>
<li><a href="#tab-2">Tab2</a></li>
<li><a href="#tab-3">Tab3</a></li>
</ul>
<div id="tab-1" class="tabContent">
Tab1
</div>
#!/bin/bash
# -*- ENCODING: UTF-8 -*-
rojo='\033[0;31m'
verde='\033[0;32m'
amarillo='\033[0;33m'
cian='\033[0;36m'
nada='\033[0m' # Sin Color
#Algunos trozos de codigo que voy ocupando
#PHP
'.text.html.php':
'Echo Php':
'prefix': 'eco'
'body': '<?=$1?>'
'Modulos Joomla':
'prefix': 'modj3'
'body': """