Skip to content

Instantly share code, notes, and snippets.

View heckctor's full-sized avatar

Hektor Peña heckctor

View GitHub Profile
if(window.location.href.indexOf("curso") != -1){//curso es la palabra que buscará
//Algo
}
@heckctor
heckctor / instalador_xampp.sh
Last active September 20, 2016 16:35
Script Bash Basico que descarga e instala V5.6.24 en GNU/Linux
#!/bin/bash
# -*- ENCODING: UTF-8 -*-
#----------------------------------------#
# XAMPP INSTALLER v1.0.0 #
#----------------------------------------#
# By: https://github.com/heckctor #
#----------------------------------------#
# ejecutar $bash instalador_xampp.sh
rutaXampp=/opt/lampp/htdocs
@heckctor
heckctor / prepos_install.sh
Last active December 9, 2019 18:36
Script basico que descarga e instala Prepros Linux 5.10.2
#!/bin/bash
# -*- ENCODING: UTF-8 -*-
#Requiere de permisos de ejecución:$chmod -x prepros_install.sh
#Ejecutar como Root: $bash prepros_install.sh
#Validando Acceso Root
if [[ $EUID -ne 0 ]]; then
echo "Tienes que ejecutar este script como Root" 1>&2
exit 1
fi
@heckctor
heckctor / lampp_install.sh
Last active March 15, 2016 05:30
Script bash básico que descarga desde google drive el zip de Xampp 5.6.19 y lo instala
#!/bin/bash
# -*- ENCODING: UTF-8 -*-
#----------------------------------------#
# XAMPP INSTALLER v1.0.0 #
#----------------------------------------#
# By: https://github.com/heckctor #
#----------------------------------------#
# ejecutar $bash xampp-files.sh
rutaXampp=/opt/lampp/htdocs
#Algunos trozos de codigo que voy ocupando
#PHP
'.text.html.php':
'Echo Php':
'prefix': 'eco'
'body': '<?=$1?>'
'Modulos Joomla':
'prefix': 'modj3'
'body': """
#!/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
<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>
@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'))){
<!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 / 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');
}