This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Turn off all error reporting | |
error_reporting(0); | |
/** | |
* Constant that is checked in included files to prevent direct access. | |
* define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower | |
*/ | |
define('_JEXEC', 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Core output | |
**/ | |
//Remove the generator tag | |
remove_action('wp_head', 'wp_generator'); | |
//Remove the frontend admin bar while in development |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import (less) "pure/base.css"; | |
@import (reference,less) 'pure/grids.css'; | |
@import (reference,less) 'pure/grids-responsive.css'; | |
@import (reference,less) 'pure/buttons.css'; | |
@import (reference,less) 'pure/menus.css'; | |
@import (reference,less) 'pure/forms.css'; | |
@import (reference,less) 'pure/tables.css'; | |
//@import 'theme/global.less'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Change wp_ to your database prefix | |
-- Change domain.com to your domain | |
-- Change string to the text you want to search for | |
SELECT | |
ID as 'Post ID', | |
post_title as 'Title', | |
CONCAT('http://www.domain.com/',post_name) as 'URL' | |
FROM `wp_posts` | |
WHERE post_type = 'post' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The following goes in a themes functions file or a custom hooks plugin | |
function custom_upload_mimes ( $existing_mimes ) { | |
$existing_mimes['epub'] = 'application/epub+zip'; | |
$existing_mimes['mobi'] = 'application/x-mobipocket-ebook'; | |
return $existing_mimes; | |
} | |
add_filter('upload_mimes', 'custom_upload_mimes'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function(){ | |
if(jQuery('.jwDisqusForm')){ | |
var interval = setInterval(function() { | |
var disqusHeight = jQuery('#disqus_thread').height(); | |
if ( disqusHeight > 52 ) { //The header is 52px high so any higher and the content is loaded | |
jQuery(window).trigger('resize'); | |
clearInterval(interval); | |
} | |
}, 100); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Initiate Joomla so we can use it's functions | |
/** | |
* Constant that is checked in included files to prevent direct access. | |
* define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower | |
*/ | |
define('_JEXEC', 1); | |
define( 'DS', DIRECTORY_SEPARATOR ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function auto_featured_image() { | |
global $post; | |
if (!has_post_thumbnail($post->ID)) { | |
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1&order=ASC&orderby=ID" ); | |
if ($attached_image) { | |
foreach ($attached_image as $attachment_id => $attachment) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Open Tas</title> | |
<script> | |
function openWindow(){ | |
var x = document.getElementById('a').value.split('\n'); | |
for (var i = 0; i < x.length; i++) | |
if (x[i].indexOf('.') > 0) | |
if (x[i].indexOf('://') < 0) |
OlderNewer