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
const useAuth = (): AuthContextInterface => { | |
const context = useContext(AuthContext); | |
if (!context) { | |
throw new Error('useAuth must be used within a AuthProvider'); | |
} | |
return context; | |
}; |
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 | |
/** | |
* Convert a multidimensional array to an object recursively. | |
* For any arrays inside another array, the result will be an array of objects. | |
* | |
* @author Marcos Freitas | |
* @param array|any $props | |
* @return array|any | |
*/ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Multiple Modals With Semantic UI</title> | |
<link rel="stylesheet" href="path_to_semantic/dist/semantic.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<script src="path_to_semantic/dist/semantic.js"></script> | |
</head> | |
<body> |
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 | |
namespace App; | |
/** | |
* Esta classe é apenas um Wrapper para a classe SoapClient e realiza as requisições e recebe as respostas de forma padrão. | |
*/ | |
class Soap { | |
public | |
$__client, |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<!-- add the semantic assets --> | |
</head> | |
<body> | |
<style> | |
/** | |
* Semantic UI don't have a fixed grid system, the solution to build fixed layouts is use a grid inside a fixed container. | |
*/ |
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
<title> | |
<?php | |
if(is_home()): | |
bloginfo('name'); | |
elseif( is_category() || is_tag() ): | |
single_cat_title(); echo ' • '; bloginfo('name'); | |
elseif( is_single() || is_page() ): | |
single_post_title(); | |
else: |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Autocomplete Search With Semantic UI</title> | |
<link rel="stylesheet" href="semantic/dist/semantic.css"> | |
</head> | |
<body> | |
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 PressKeyToContinue() { | |
printf "\n"; | |
question="Pressione S para continuar ou qualquer outra tecla para pular essa parte execução do script"; | |
expected_key_pressed='s'; | |
abort_script=false; | |
if [ ! -z "$1" ]; then | |
question="${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
/** | |
* Dropdown de categorias para design responsivo | |
* Pegando as categorias dos produtos de acordo com os argumentos passados | |
*/ | |
$args = array( 'number' => $number, 'orderby' => $orderby, 'order' => $order, 'hide_empty' => true, 'include' => $ids ); | |
$product_categories = get_terms( 'product_cat', $args ); | |
?> | |
<ul id="list-widget-responsive"> | |
<li id="" class="widget widget-responsive woocommerce widget_product_categories"> |
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 | |
# check for palindrome words | |
# if the word have almost 1 letter to be changed to be a plindrome, it will be a palíndrome. | |
function isAlmostPalindrome($word) { | |
$count_diference = 0; | |
$word_reverse = strrev($word); | |
$word_as_array = str_split($word); |
NewerOlder