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
| from decimal import Decimal | |
| def calc(num): | |
| rs = '' | |
| try: | |
| num = int(num) | |
| except ValueError: | |
| try: | |
| num = Decimal(num) |
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 for post duplication. Dups appear as drafts. User is redirected to the edit screen | |
| */ | |
| function sig_duplicate_post_as_draft(){ | |
| global $wpdb; | |
| if (! ( isset( $_GET['post']) || isset( $_POST['post']) || ( isset($_REQUEST['action']) && 'sig_duplicate_post_as_draft' == $_REQUEST['action'] ) ) ) { |
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
| add_filter( 'has_post_thumbnail' ,function(){ | |
| return true; | |
| }); | |
| add_filter( 'post_thumbnail_html' ,function ( $html, $post_id, $post_thumbnail_id ){ | |
| if( empty($html) ){ | |
| global $post; | |
| if ($img = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches)); | |
| if ( isset($matches[1][0]) ){ | |
| $id = attachment_url_to_postid($matches[1][0]); |
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
| #!/usr/bin/env bash | |
| clear | |
| # User Inputs | |
| read -p "Site URL: " url | |
| read -p "Site title: " title | |
| read -p "DB Name: " dbname | |
| read -p "DB User: " dbuser | |
| read -p "DB Pass: " dbpass | |
| read -p "WP version [Enter is default]: " wpver |
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
| public function check_gd( $args = array() ) { | |
| if ( ! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) { | |
| return false; | |
| } | |
| return true; | |
| } |
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
| public function check_imagick() { | |
| // check Imagick's extension and classes | |
| if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick', false ) || ! class_exists( 'ImagickPixel', false ) ) | |
| return false; | |
| // check version | |
| if ( version_compare( phpversion( 'imagick' ), '2.2.0', '<' ) ) | |
| return false; | |
| // check for deep requirements within Imagick |
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 | |
| class Curl { | |
| protected $token = ""; | |
| protected $http_status_code = 0; | |
| public function __construct() { | |
| } |
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
| $('#menu-items').sortable({ | |
| placeholder: "placeholder", | |
| sort: function( event, ui ) { | |
| if( ui.item.index() > 0 && ui.position.left > 80){ | |
| $('.placeholder').css('margin-left','30px'); | |
| } | |
| }, | |
| stop: function( event, ui ) { | |
| if( ui.item.index() > 0 && ui.position.left > 80){ | |
| ui.item.css('margin-left','30px'); |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="2.0" | |
| xmlns="http://www.w3.org/1999/xhtml" | |
| xmlns:html="http://www.w3.org/TR/REC-html40" | |
| xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" | |
| xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" | |
| xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> | |
| <xsl:template match="/"> |
NewerOlder