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
<div id="progress-bar"><div style="width:0;"></div> | |
<script> | |
let progressBar = document.querySelector("#progress-bar div") | |
let items = []; | |
for (let index = 0; index <= 100; index++) { | |
items.push(index); | |
} | |
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
#!/bin/bash | |
# Argument is path + filename of .sql file dump. | |
mysql database_name -u user_name -p --host=127.0.0.1 --port=33060 < $1 |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Cache TTL | |
|-------------------------------------------------------------------------- | |
| | |
| Set commonly used TTL values. | |
| | |
*/ | |
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
const endpoint = 'https://api.some.endpoint.test'; | |
const formId = 'this-form-id-value'; | |
const data = new FormData(document.getElementById('formId')); | |
$.ajax({ | |
async: true, | |
contentType: false, | |
processData: false, | |
url: endpoint, | |
method: '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
<div class="loading hidden"><i class="fa fa-spin fa-circle-o-notch" style="font-size: 48px;"></i></div> | |
<script type="text/javascript"> | |
const formData = new FormData(); | |
formData.append('key', 'value'); | |
$.ajax({ | |
async: true, | |
contentType: false, | |
processData: false, |
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 | |
/** | |
* Checks if string is valid JSON. | |
* | |
* @param string $string | |
* @return bool | |
*/ | |
public function jsonCheck($string) | |
{ |
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 | |
/** | |
* Match pattern PT#H#M#S (leading PT, hours, minutes, seconds) and return seconds value. | |
* | |
* @param string $string | |
* @return int | |
*/ | |
private static function convertDuration($string) | |
{ | |
// Comprehensive regex that should match any value. |
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
<style> | |
#overlay { | |
background: #000; | |
color: #fff; | |
position: fixed; | |
height: 100%; | |
width: 100%; | |
z-index: 5000; | |
top: 0; | |
left: 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
<?php | |
namespace App\Exceptions; | |
use Illuminate\Auth\AuthenticationException; | |
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | |
use Symfony\Component\ErrorHandler\Exception\FlattenException; | |
use Throwable; | |
class Handler extends ExceptionHandler |