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 status(){ | |
| $status = session_status(); | |
| switch ($status) { | |
| case PHP_SESSION_DISABLED: | |
| echo 'PHP is complied with --disable-session option'; | |
| break; | |
| case PHP_SESSION_NONE: | |
| echo 'No active session'; | |
| break; |
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
| $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; | |
| $url = $actual_link; | |
| $path = parse_url($url, PHP_URL_PATH); | |
| $pathFragments = explode('/', $path); | |
| $end = end($pathFragments); | |
| echo $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
| <?php | |
| function showPdoError($e) | |
| { | |
| $error = 'Could Not Connect: '.$e->getMessage().'<br>'; | |
| $error .= 'There is an error on line: '.$e->getLine().'<br>'; | |
| $error .= 'Error Number: '.$e->getCode().'<br>'; | |
| $error .= 'Error File Location: '.$e->getFile(); | |
| return $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
| function Stopwatch() { | |
| let startTime, endTime, running, duration = 0; | |
| this.start = function(){ | |
| if(running){ | |
| throw new Error('Stopwatch has already started'); | |
| } | |
| running = true; | |
| startTime = new Date(); | |
| }; |
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
| // composer require | |
| // "elasticsearch/elasticsearch": "^7.0", | |
| // "fzaninotto/faker": "^1.8" | |
| <?php | |
| use Elasticsearch\ClientBuilder; | |
| require 'vendor/autoload.php'; | |
| set_time_limit(0); |
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
| files = { | |
| "functools": ["reduce", "cache", "lru_cache"], | |
| "json": "", | |
| "hashlib": ["sha3_256"] | |
| } | |
| def unlimited_files(keyword_args): | |
| lib = {} | |
| for k, b in keyword_args.items(): |
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 { ethers } from "ethers"; | |
| const API_KEY = YOUR_API_KEY; | |
| const network = "homestead"; | |
| const provider = ethers.getDefaultProvider(network, { | |
| etherscan: API_KEY, | |
| }); | |
| const blockNumber = await provider.getBlockNumber(); | |
| console.log(blockNumber); |