Skip to content

Instantly share code, notes, and snippets.

@AleeRojas
AleeRojas / excepciones
Last active December 19, 2015 10:09
Manejo de excepciones - Clases: Jueves 4 Jul
using System;
namespace ConsoleApplication2
{
class Program
{
$('.dropdown-menu').hide();
// Nav Dropdown
$('#navigation li').hover(function(){
$(this).find('.dropdown-menu').toggle();
});
@AleeRojas
AleeRojas / migrarimagenes
Last active December 19, 2015 11:49
Cambiar URL de las imagenes al migrar sitio Wordpress
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
@AleeRojas
AleeRojas / gist:6106736
Created July 29, 2013 18:56
Leave menu bar fixed on top when scrolled
/* Dynamic top menu positioning
*
*/
var num = 300; //number of pixels before modifying styles
$(window).bind('scroll', function () {
if ($(window).scrollTop() > num) {
$('.navbar').addClass('navbar-fixed-top');
} else {
@AleeRojas
AleeRojas / gist:6168401
Created August 6, 2013 20:39
Embed SWF
<object type="application/x-shockwave-flash" width="200" height="250" data="http://www.diarioelranco.cl/wp-content/publicidad/2013/larrainyfuenzalida.swf">
<param name="movie" value="video.swf">
<param name="wmode" value="transparent">
<!--[if lte IE 6 ]>
<embed src="http://www.diarioelranco.cl/wp-content/publicidad/2013/larrainyfuenzalida.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="200" height="250"></embed>
<![endif]-->
<!-- ultimate fallback when there is no HTML5 video support and no Flash support -->
<img src="http://placehold.it/200x250" width="200" height="250">
</object>
<?php
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
wp_deregister_script( 'contact-form-7' );
}
<?>
@AleeRojas
AleeRojas / gist:6427074
Created September 3, 2013 17:40
Agregar contenido antes de content
<?php
//http://wordpress.stackexchange.com/questions/39918/wordpress-hooks-filters-insert-before-content-or-after-title
function theme_slug_filter_the_title( $title ) {
$custom_title = 'YOUR CONTENT GOES HERE';
$title .= $custom_title;
return $title;
}
add_filter( 'the_title', 'theme_slug_filter_the_title' );
?>
$('myOjbect').css('background-image', 'url(' + imageUrl + ')');
comerybeber = 'info.json'
$.getJSON( comerybeber, function() {
console.log( "success" );
})
.done(function( data ) {
// console.log(data);
$.each( data, function( i, item ) {
console.log(this);
console.log(item.latitud);
@AleeRojas
AleeRojas / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console