Skip to content

Instantly share code, notes, and snippets.

@setuix
setuix / cd_key.vbe
Created September 7, 2015 00:16
How to Find and Save Your Windows 10 Product Key
Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
<?php // Opening PHP tag - nothing should be before this, not even whitespace
// Custom Function to Include
function favicon_link() {
echo '<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />' . "\n";
}
add_action( 'wp_head', 'favicon_link' );
@setuix
setuix / childtheme.css
Last active August 29, 2015 14:19
Child Theme Info
/*
Theme Name: Setuix Solutions Child Theme
Theme URI: http://setuix.com
Description: Setuix Solutions Child Theme
Author: John Doe
Author URI: http://setuix.com
Template: genesis
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
<?php
$today = current_time('mysql', 1);
$howMany = 5; //Number of posts you want to display
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_modified_gmt < '$today' ORDER BY post_modified_gmt DESC LIMIT $howMany")):
?>
<h2><?php _e("Recent Updates"); ?></h2>
<ul>
<?php
foreach ($recentposts as $post) {
if ($post->post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID);
@setuix
setuix / most_commented_without_plugin
Created February 13, 2015 15:35
most_commented_without_plugin
<?php $popular = newWP_Query('orderby=comment_count&posts_per_page=5'); ?>
<?php while ($popular->have_posts()) : $popular->the_post(); ?>
<?php $justanimage = get_post_meta($post->ID,'thumbnail', true);
if ($justanimage) { ?>
<img src="<?php echo get_post_meta($post->ID, "Image", true); ?>" alt="<?php the_title(); ?>" />
<?php } else { ?>
<img src="<a href="/web/20120228235855/http://an-alternative-image.jpg"" rel="nofollow">http://an-alternative-image.jpg&quot</a>; alt="" />
<?php } ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php endwhile; ?>
function fb_move_admin_bar() { ?>
<style type="text/css">
body {
margin-top: -28px;
padding-bottom: 28px;
}
body.admin-bar <a href="/web/20131207125717/http://search.twitter.com/search?q=%23wphead" class="tweet-hashtag">#wphead</a> {
padding-top: 0;
}
body.admin-bar <a href="/web/20131207125717/http://search.twitter.com/search?q=%23footer" class="tweet-hashtag">#footer</a> {
<?php echo my_excerpts(); ?>
<?php add_filter('the_excerpt', 'my_excerpts');
function my_excerpts($content = false) {
global $post;
$mycontent = $post->post_excerpt;
$mycontent = $post->post_content;
$mycontent = strip_shortcodes($mycontent);
$mycontent = str_replace(']]>', ']]&gt;',$mycontent);
$mycontent = strip_tags($mycontent);
$excerpt_length = 55;
$words = explode(' ', $mycontent,$excerpt_length + 1);
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
wp_clear_scheduled_hook( 'wp_version_check' );
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
wp_clear_scheduled_hook( 'wp_update_plugins' );