Skip to content

Instantly share code, notes, and snippets.

View rodrigobertin's full-sized avatar

RNB Developer rodrigobertin

View GitHub Profile
@rodrigobertin
rodrigobertin / seleccionado.js
Created January 15, 2014 23:52
Option seleccionado con jquery
$("#provincia option[value="+ valor +"]").attr("selected",true);
@rodrigobertin
rodrigobertin / rezise.php
Created June 13, 2015 15:14
rezise image
//redimensionar
function rezise($SrcImage, $DestImage, $MaxWidth=980, $MaxHeight=0, $Quality=90) {
list($iWidth, $iHeight, $type)=getimagesize($SrcImage);
//echo $type;
//solo redimensional mayores a 1200
if ($iWidth>3000 || $iHeight>3000) {
//=== si no se pone el alto ====//
if (($MaxHeight == 0) && isset($MaxWidth)) {
@rodrigobertin
rodrigobertin / installCentos.sh
Last active March 9, 2017 15:44
Instalaciones CENTOS Vagrant
#Actualizar
yum update
#instalar apache
yum install -y httpd
#iniciar apache
sudo service httpd start
#nano
@rodrigobertin
rodrigobertin / hide-editor.php
Created September 18, 2017 13:56
Hide editor in certain pages
<?php
/**
* Hide the main editor on specific pages
*/
define('EDITOR_HIDE_PAGE_TITLES', json_encode(array()));
define('EDITOR_HIDE_PAGE_TEMPLATES', json_encode(array('template-cars.php')));
/**
* Hide the main editor on defined pages
@rodrigobertin
rodrigobertin / fixHeader.js
Created October 4, 2017 02:13
Fix Header
$(window).scroll(function(){
if ($(window).scrollTop() >= 300) {
$('nav').addClass('fixed-header');
}
else {
$('nav').removeClass('fixed-header');
}
});
@rodrigobertin
rodrigobertin / js_css.php
Created October 5, 2017 04:40
Cargar JS y CSS Wordpress
<?php
// Load the theme stylesheets
function theme_styles() {
// Example of loading a jQuery slideshow plugin just on the homepage
wp_register_style(
'bootstrap-styles', // handle name
get_template_directory_uri() . '/css/styles.min.css', // the URL of the stylesheet
array(), // an array of dependent styles
@rodrigobertin
rodrigobertin / nav.js
Created October 5, 2017 05:04
Nav animado
$('nav a').on('click', function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top}, 500);
});
@rodrigobertin
rodrigobertin / metas.html
Created October 11, 2017 10:45
Meta tags Template
<!-- Actualiza tu etiqueta HTML para incluir itemscope y itemtype. -->
<html itemscope itemtype="http://schema.org/Article">
<!-- Coloca estos datos entre las etiquetas <head> de tu página web -->
<title>Título de la página. Longitud máxima 60-70 caracteres</title>
<meta name="description" content="Descripción de la página. Longitud máxima 155 caracteres." />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Google Authorship y Marcado de Anunciante -->
<link rel="author" href="<a "="">https://plus.google.com/[Perfil_Google+]/posts"/>
@rodrigobertin
rodrigobertin / disable_post.php
Last active October 11, 2017 10:48
Disable post menu
<?php
function remove_posts_menu() {
remove_menu_page('edit.php');
}
add_action('admin_init', 'remove_posts_menu');
@rodrigobertin
rodrigobertin / installPHP.sh
Last active August 22, 2018 11:29
Instalaciones PHP Completas
#!/usr/bin/env bash
#Basics
sudo apt-get install -y nano
sudo apt-get install -y build-essential
sudo apt-get install -y software-properties-common
sudo apt-get install -y python-software-properties
sudo apt-get install -y mc
#Repositorio de php extra