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 server = require('./server'); | |
| console.log('Checking if database tables are up to date...'); | |
| const dataSource = server.dataSources.db; | |
| const modelsNamesInLowerCase = []; | |
| const modelsToCheck = []; | |
| Object.keys(server.models).forEach((model) => { | |
| if (modelsNamesInLowerCase.indexOf(model.toLowerCase()) !== -1) return; |
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
| import {PhpTimeToJsDatePipe} from './php-time-to-js-date.pipe'; | |
| describe('PhpTimeToJsDatePipe', () => { | |
| it('correctly transform "1510688296" into "14 de nov de 2017"', () => { | |
| const pipe = new PhpTimeToJsDatePipe('pt-BR'); | |
| expect(pipe.transform(1510688296)).toBe('14 de nov de 2017'); | |
| }); | |
| }); |
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
| <!DOCTYPE html> | |
| <html lang="en-us"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <title>Game</title> | |
| <link rel="shortcut icon" href="TemplateData/favicon.ico"> | |
| <link rel="stylesheet" href="TemplateData/style.css"> | |
| <script src="TemplateData/UnityProgress.js"></script> | |
| <script src="Build/UnityLoader.js"></script> |
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
| var lastCheckedValue = null; | |
| $("#cep").blur(function () { | |
| var cep = $(this).val().replace(/\D/g, ""); | |
| if (cep.length != 8) { | |
| console.error("CEP deve ser composto por exatamente 8 caracteres numéricos."); | |
| return; | |
| } | |
| if (cep == lastCheckedValue) |
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
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class Permutation { | |
| private List<String> result = new ArrayList<String>(); | |
| public Permutation(int number) { | |
| List<Integer> sequence = new ArrayList<Integer>(); |
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 | |
| /** | |
| * Replaces the last occurrence of a string in a string. | |
| * | |
| * @param string $search The value being searched for. | |
| * @param string $replace The replacement string. | |
| * @param string $subject The string being searched and replaced on. | |
| * | |
| * @return string The string with the replaced values. | |
| */ |
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 | |
| /** | |
| * Improved mail function to correctly send UTF-8 characters. | |
| * | |
| * @param string $to Receiver email. | |
| * @param string $from_name Receiver name. | |
| * @param string $from_email Sender email. | |
| * @param string $subject Mail subject. | |
| * @param string $message Mail content. | |
| * @param string $cc CC emails. |
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 = 'example.com'; | |
| $port = 80; | |
| $fp = fsockopen($host, $port, $errno, $errstr, 2); | |
| if($fp) | |
| { | |
| echo "Port $port is open on $host."; | |
| fclose($fp); | |
| } | |
| else |
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 | |
| class RandomName | |
| { | |
| private static $maleNameList = ['Aaron','Abdul','Abe','Abel','Abraham','Abram','Adalberto','Adam','Adan','Adolfo','Adolph','Adrian','Agustin','Ahmad','Ahmed','Al','Alan','Albert','Alberto','Alden','Aldo','Alec','Alejandro','Alex','Alexander','Alexis','Alfonso','Alfonzo','Alfred','Alfredo','Ali','Allan','Allen','Alonso','Alonzo','Alphonse','Alphonso','Alton','Alva','Alvaro','Alvin','Amado','Ambrose','Amos','Anderson','Andre','Andrea','Andreas','Andres','Andrew','Andy','Angel','Angelo','Anibal','Anthony','Antione','Antoine','Anton','Antone','Antonia','Antonio','Antony','Antwan','Archie','Arden','Ariel','Arlen','Arlie','Armand','Armando','Arnold','Arnoldo','Arnulfo','Aron','Arron','Art','Arthur','Arturo','Asa','Ashley','Aubrey','August','Augustine','Augustus','Aurelio','Austin','Avery','Barney','Barrett','Barry','Bart','Barton','Basil','Beau','Ben','Benedict','Benito','Benjamin','Bennett','Bennie','Benny','Benton','Bernard','Bernardo','Bernie','Berry','Bert','Bertram','Bill','Billie |
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 | |
| // Recommended way for versions of PHP >= 5.4.0: | |
| if (session_status() == PHP_SESSION_NONE && !headers_sent()) { | |
| session_start(); | |
| } | |
| // For versions of PHP < 5.4.0: | |
| if(session_id() == '' && !headers_sent()) { | |
| session_start(); |