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 | |
| $hostname = 'localhost'; | |
| $user = 'root'; | |
| $password = ''; | |
| $database = 'select'; | |
| $conn = new mysqli($hostname, $user, $password, $database); | |
| if($conn->connect_errno) { |
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 | |
| $usuario = 'root'; | |
| $senha = ''; | |
| $database = 'login'; | |
| $host = 'localhost'; | |
| $mysqli = new mysqli($host, $usuario, $senha, $database); | |
| if($mysqli->error) { |
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 | |
| $host = "localhost"; | |
| $db = "carros"; | |
| $user = "root"; | |
| $pass = ""; | |
| $mysqli = new mysqli($host, $user, $pass, $db); | |
| if($mysqli->connect_errno) { | |
| die("Falha na conexão com o banco de dados"); |
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
| const request = require('request'); | |
| const fs = require('fs'); | |
| const puppeteer = require('puppeteer'); | |
| const API_KEY = "SUA_API_KEY_DO_2captcha"; | |
| async function curl(options) { | |
| return new Promise((resolve, reject) => { | |
| request(options, (err, res, body) => { | |
| if(err) |
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
| const request = require('request'); | |
| const puppeteer = require('puppeteer'); | |
| const API_KEY = "SUA_API_KEY_NO_2captcha" | |
| async function curl(options) { | |
| return new Promise((resolve, reject) => { | |
| request(options, (err, res, body) => { | |
| if(err) | |
| return reject(err); |
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
| const scrape = require('website-scraper'); | |
| const PuppeteerPlugin = require('website-scraper-puppeteer'); | |
| const path = require('path'); | |
| scrape({ | |
| // Forneça a URL do site que você quer copiar | |
| urls: ['https://site-que-voce-quer-copiar.com.br'], | |
| // Especifique a pasta onde os arquivos do site serão salvos em pasta-do-site | |
| directory: path.resolve(__dirname, 'pasta-do-site'), |
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
| let data_americana = "2020-12-30"; | |
| let data_brasileira = data_americana.split('-').reverse().join('/'); | |
| // Pronto! A data foi convertida. | |
| console.log(data_brasileira); // retorna: 30/12/2020 |
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 | |
| $variaveis_extras = http_build_query($_POST); | |
| $url = "http://ws.correios.com.br/calculador/CalcPrecoPrazo.aspx?nCdEmpresa=&sDsSenha=&sCdAvisoRecebimento=n&sCdMaoPropria=n&nVlValorDeclarado=0&nVlDiametro=0&StrRetorno=xml&nIndicaCalculo=3&nCdFormato=1&" . $variaveis_extras; | |
| $unparsedResult = file_get_contents($url); | |
| $parsedResult = simplexml_load_string($unparsedResult); | |
| $retorno = array( | |
| 'preco' => strval($parsedResult->cServico->Valor), |
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
| function zb_change_return_shop_url() { | |
| return home_url() . "/sua-pagina-personalizada"; | |
| } | |
| add_filter( 'woocommerce_return_to_shop_redirect', 'zb_change_return_shop_url' ); |
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
| // créditos: http://semplicewebsites.com/removing-accents-javascript | |
| function removerAcentos(str) { | |
| let base64map="eyLDgSI6IkEiLCLEgiI6IkEiLCLhuq4iOiJBIiwi4bq2IjoiQSIsIuG6sCI6IkEiLCLhurIiOiJBIiwi4bq0IjoiQSIsIseNIjoiQSIsIsOCIjoiQSIsIuG6pCI6IkEiLCLhuqwiOiJBIiwi4bqmIjoiQSIsIuG6qCI6IkEiLCLhuqoiOiJBIiwiw4QiOiJBIiwix54iOiJBIiwiyKYiOiJBIiwix6AiOiJBIiwi4bqgIjoiQSIsIsiAIjoiQSIsIsOAIjoiQSIsIuG6oiI6IkEiLCLIgiI6IkEiLCLEgCI6IkEiLCLEhCI6IkEiLCLDhSI6IkEiLCLHuiI6IkEiLCLhuIAiOiJBIiwiyLoiOiJBIiwiw4MiOiJBIiwi6pyyIjoiQUEiLCLDhiI6IkFFIiwix7wiOiJBRSIsIseiIjoiQUUiLCLqnLQiOiJBTyIsIuqctiI6IkFVIiwi6py4IjoiQVYiLCLqnLoiOiJBViIsIuqcvCI6IkFZIiwi4biCIjoiQiIsIuG4hCI6IkIiLCLGgSI6IkIiLCLhuIYiOiJCIiwiyYMiOiJCIiwixoIiOiJCIiwixIYiOiJDIiwixIwiOiJDIiwiw4ciOiJDIiwi4biIIjoiQyIsIsSIIjoiQyIsIsSKIjoiQyIsIsaHIjoiQyIsIsi7IjoiQyIsIsSOIjoiRCIsIuG4kCI6IkQiLCLhuJIiOiJEIiwi4biKIjoiRCIsIuG4jCI6IkQiLCLGiiI6IkQiLCLhuI4iOiJEIiwix7IiOiJEIiwix4UiOiJEIiwixJAiOiJEIiwixosiOiJEIiwix7EiOiJEWiIsIseEIjoiRFoiLCLDiSI6IkUiLCLElCI6IkUiLCLEmiI6IkUiLCLIqCI6IkUiLCLhuJwiOiJFIiwi |
NewerOlder