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 | |
/** | |
* Obligatory alert of to use the thumbnail before publishing any article | |
*/ | |
function featured_image_requirement() { | |
if(!has_post_thumbnail()) { | |
wp_die( '<div>Your post is without thumbnail!</div><br><button class="button button-primary button-large" onclick="history.go(-1);">Back to posting</button>'); | |
} |
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
DROP FUNCTION IF EXISTS fn_idade; | |
DELIMITER $$ | |
CREATE FUNCTION fn_idade(data_nascimento DATE) | |
RETURNS INT | |
LANGUAGE SQL | |
BEGIN | |
RETURN (Year(Curdate()) - Year(data_nascimento)) -(Right(Curdate(),5) < (Right(data_nascimento,5))); | |
END; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define TAM 100 | |
#define QUA 100 | |
struct Alternativas | |
{ | |
float nota[TAM]; | |
float classificacao[TAM][TAM]; |
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
<!-- Get Head --> | |
<?php wp_head(); ?> | |
<!-- The title --> | |
<?php wp_title(''); ?> | |
<!-- Get Template Directory URI --> | |
<?php echo get_template_directory_uri(); ?> |
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 | |
/** | |
* get_the_date - Retrieves the date the current $post was written | |
*/ | |
get_the_date( $date ); | |
/** | |
* get_comments_number - Retrieves the value of the total number of comments for a 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
<?php | |
// Nav Menu Dropdown Class | |
include_once( CHILD_DIR . '/lib/classes/nav-menu-dropdown.php' ); | |
/** | |
* Mobile Menu | |
* | |
*/ | |
function be_mobile_menu() { |
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 | |
/** | |
* truncate a string provided by the maximum limit without breaking a word | |
* @param string $str | |
* @param integer $maxlen | |
* @return string | |
*/ | |
function truncateStringWords($str, $maxlen) { | |
if (strlen($str) <= $maxlen) return $str; |
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
package escola; | |
import java.util.ArrayList; | |
public class Aluno extends Pessoa { | |
private int numeroMatricula; | |
private int anoInicioCurso; | |
private Bolsa bolsa; | |
private ArrayList<Disciplina> disciplinas; |
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 | |
/** | |
* Converting address to latitude and longitude | |
*/ | |
function setLatitudeAndLongitude($address) { | |
$address = urlencode($address); | |
$request_url = "http://maps.googleapis.com/maps/api/geocode/xml?address=".$address."&sensor=true"; | |
$xml = simplexml_load_file($request_url) or die("url not loading"); | |
$status = $xml->status; |
OlderNewer