This file contains 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
function sumAll(arr) { | |
arr.sort(function(a,b) { return a - b } ); | |
num1 = arr[0]; | |
num2 = arr[1]; | |
numbers = []; | |
This file contains 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
function reverseString(str) { | |
splitted = str.split(""); | |
reversed = splitted.reverse(); | |
joined = reversed.join(""); | |
return joined; | |
} | |
reverseString("hello"); |
This file contains 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 requests | |
from requests.auth import HTTPBasicAuth | |
import httplib | |
def have_internet(): | |
conn = httplib.HTTPConnection("www.google.com", timeout=5) | |
try: | |
conn.request("HEAD", "/") | |
conn.close() | |
return True |
This file contains 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 | |
return array( | |
'ABeeZee' => 'ABeeZee', | |
'Abel' => 'Abel', | |
'Abhaya Libre' => 'Abhaya Libre', | |
'Abril Fatface' => 'Abril Fatface', | |
'Aclonica' => 'Aclonica', | |
'Acme' => 'Acme', | |
'Actor' => 'Actor', | |
'Adamina' => 'Adamina', |
This file contains 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 Flash_Color_Palette_Control extends WP_Customize_Control { | |
public function render_content() { | |
if ( empty( $this->choices ) ) | |
return; | |
$name = '_customize-radio-' . $this->id; | |
?> |
This file contains 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
var comments_container = 'div#comments'; | |
var content_container = 'div#content'; | |
var nav_container = 'nav.post-navigation'; | |
var post_title_selector = 'h1.entry-title'; | |
var curr_url = window.location.href; | |
jQuery.noConflict(); | |
jQuery(document).ready(function() { |
This file contains 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 | |
// Dequeue Styles | |
function onepress_child_dequeue_unnecessary_styles() { | |
wp_dequeue_style( 'onepress-animate' ); | |
wp_deregister_style( 'onepress-animate' ); | |
} | |
add_action( 'wp_print_styles', 'onepress_child_dequeue_unnecessary_styles' ); | |
// Dequeue JavaScripts | |
function onepress_child_dequeue_unnecessary_scripts() { |
This file contains 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 | |
$args = array( | |
'post_type' => 'product', | |
'orderby' => 'title', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'product_cat', | |
'field' => 'id', | |
'terms' => $category | |
), |
This file contains 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 | |
$get_featured_cats = array( | |
'taxonomy' => 'product_cat', | |
'orderby' => 'name', | |
'hide_empty' => '0', | |
'include' => $cat_array | |
); | |
$all_categories = get_categories( $get_featured_cats ); | |
$j = 1; |
This file contains 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 | |
add_action( 'wp_enqueue_scripts', 'colormag_scripts_styles_method' ); | |
/** | |
* Enqueues styles and scripts. | |
*/ | |
function colormag_scripts_styles_method() { | |
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; | |
if(is_active_widget( '', '', 'colormag_category_post_slider')){ |
NewerOlder