Skip to content

Instantly share code, notes, and snippets.

@cesarkohl
cesarkohl / wordpress-update-urls
Created July 7, 2015 20:56
wordpress update URLs
UPDATE wp_posts SET post_content = replace(post_content, 'http://old/', 'http://new/');
UPDATE wp_posts SET guid = replace(guid, 'http://old/', 'http://new/');
@cesarkohl
cesarkohl / css-media-bootstrap
Last active September 11, 2015 17:15
css @media bootstrap
/**
* Media: Larger than
*/
@media (min-width: 1200px){
}
@media (min-width: 992px){
}
@media (min-width: 768px){
@cesarkohl
cesarkohl / jquery-get-all-html-including-tag
Created July 1, 2015 18:59
jQuery) Get all html including tag
<div>
<span>Hello</span>
</div>
$('div').wrap().parent().html();
@cesarkohl
cesarkohl / gist:172905d0692ad502ccc2
Created June 21, 2015 10:24
add wordpress [] tag in PHP
<?php echo do_shortcode('[contact-form 1 "Form"]'); ?>
@cesarkohl
cesarkohl / html-center-items
Last active September 11, 2015 12:51
HTML center items
.center-items { overflow: auto; list-style-type: none; text-align: center; }
.center-items .item { display: inline-block; vertical-align: top; }
<div class="center-items">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
</div>
@cesarkohl
cesarkohl / youtube-pause.js
Last active January 17, 2018 19:06 — forked from cferdinandi/stop-video.js
Youtube Pause Video
var youtube_video = $('iframe');
var url = youtube_video.attr('src'); // 1. First get the iframe URL
youtube_video.attr('src', ''); // 2. Then assign the src to null, this then stops the video been playing
youtube_video.attr('src', url); // If you need to reassign the URL back to your iframe, so when you hide and load it again you still have the link
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
@cesarkohl
cesarkohl / current-url
Created June 7, 2015 20:13
Raw PHP to get current URL
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$actual_page = $_SERVER[REQUEST_URI];
@cesarkohl
cesarkohl / mysql-myisam-to-innodb
Last active August 29, 2015 14:21
MySQL - MyISAM to InnoDB
// Run this SQL statement (in the mysql client, phpMyAdmin, or wherever) to retrieve all the MyISAM tables in your database.
// Replace value of the name_of_your_db variable with your database name.
// Then, copy the output and run as a new SQL query.
SET @DATABASE_NAME = 'name_of_your_db';
SELECT CONCAT('ALTER TABLE `', table_name, '` ENGINE=InnoDB;') AS sql_statements
FROM information_schema.tables AS tb
WHERE table_schema = @DATABASE_NAME
AND `ENGINE` = 'MyISAM'
@cesarkohl
cesarkohl / codeigniter-pagination-with-get
Created March 16, 2015 16:21
CodeIgniter Pagination URL with GET Parameters
// http://subhra.me/codeigniter-pagination-url-get-parameters/
if (count($_GET) > 0) $config['suffix'] = '?' . http_build_query($_GET, '', "&");
$config['first_url'] = $config['base_url'].'?'.http_build_query($_GET);