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
/* Woocommerce Shipping */ | |
// Hide standard shipping when free is available | |
// Original script https://gist.github.com/pauloiankoski/9707209 | |
add_filter( 'woocommerce_available_shipping_methods', 'mf_hide_standard_shipping_when_free_is_available' , 10, 1 ); | |
function mf_hide_standard_shipping_when_free_is_available( $available_methods ) { | |
global $woocommerce; | |
// First the free shipping method is only available to local delivery |
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
// Register Custom Post Type | |
function c4n_new_post_type() { | |
$labels = array( | |
'name' => _x( 'Journals', 'Post Type General Name', 'turing_press' ), | |
'singular_name' => _x( 'Journal', 'Post Type Singular Name', 'turing_press' ), | |
'menu_name' => __( 'Journals', 'turing_press' ), | |
'parent_item_colon' => __( 'Parent Journal:', 'turing_press' ), | |
'all_items' => __( 'All Journals', 'turing_press' ), | |
'view_item' => __( 'View Journal', 'turing_press' ), |
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 inArray(byVal value, byVal my_array) | |
Dim i | |
inArray = false | |
For i=0 To Ubound(my_array) | |
If (my_array(i) = value) Then | |
inArray = true | |
Exit Function | |
End If |
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 | |
header('Content-type: application/json; charset=utf-8'); | |
$colors = '{"results" :[ | |
{ | |
"title":"red", | |
"description":"dark red like blood" | |
}, | |
{ | |
"title":"green", |
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
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Registration.aspx.cs" Inherits="ITI_Intake_34.Day_5.Registration" %> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="description" content="A form displays a set of related user input fields in a structured way" /> | |
<meta name="keywords" content="html5, ui, library, framework, javascript" /> | |
<title>Semantic Ui</title> |
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
' | |
1º LEFT OUTER JOIN somente a soma das avaliacoes | |
2º LEFT OUTER JOIN somente a quantidade das avaliacoes | |
resulta na média | |
POSTS, COMENTARIOS, METADADOS_COMENTARIOS | |
inner join nao vai trazer os posts sem comentarios ou comentarios sem classificacao rating | |
left outer join vai trazer os posts, comentarios coincidentes no inner (na relacao descrita no ON) e tambem os posts sem comentarios, comentario sem rating | |
select * from POSTS | |
select * from COMENTARIOS as c | |
left outer join METADADOS_COMENTARIOS as mc |
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
/* ========================================================================== | |
Buttons Class Configurations | |
========================================================================== */ | |
/* | |
* Redefinition to bootstrap buttons | |
*/ | |
.btn, .btn[disabled], .btn:focus, .btn:hover, .btn:active{ | |
color: #333; | |
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); |
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 | |
(..) | |
$attached_media = get_attached_media( $this->supported_types, $this->post_id ); | |
foreach ($attached_media as $key => $value) { | |
$attachment_url = $attached_media[$key]->guid; | |
} | |
(...) |
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 | |
/* Subcategories of "Journals" (id: 6) */ | |
$categories = get_categories('child_of=6&hide_empty=0'); | |
foreach ($categories as $cat): | |
/* This get the total of posts in current category of the loop.*/ | |
$total_of_posts_in_category = (int) $cat->count; | |
$current_category_name = $cat->name; | |
/* For each category, make the loop for the amount of posts */ |
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 | |
/** | |
* This script will redirect users from determined URL in accord with the your: | |
* COUNTRY_NAME, COUNTRY_CODE, CITY (name), REGION_CODE or REGION_NAME returned by freegeoip.net webservice | |
* @author Marcos Freitas - marcosfreitas[at]c4network[dot]com[dot]br | |
* -- | |
* Thanks to freegeoip.net for the 'simple' webservice. | |
*/ | |
// Redirect function | |
function Redirect($url, $permanent){ |