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
/** | |
* This file is responsible for caching mongo model instance for specific time. | |
* Usage example: | |
* Store.findOne(query, fields).cacheResults(1 * 60).exec(); // it'll cache result for specified seconds | |
* Store.findOne(query, fields).removeCache().exec(); // it'll remove any existing cache | |
*/ | |
// @ts-nocheck | |
import mongoose from 'mongoose'; |
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
import objectToFormData from 'objectToFormData'; | |
let test_obj = { | |
a: 'b' | |
}; | |
let formDataObj = objectToFormData(test_obj); | |
axios.post('your url', formDataObj); |
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 | |
$timezones = array( | |
'America/Adak' => '(GMT-10:00) America/Adak (Hawaii-Aleutian Standard Time)', | |
'America/Atka' => '(GMT-10:00) America/Atka (Hawaii-Aleutian Standard Time)', | |
'America/Anchorage' => '(GMT-9:00) America/Anchorage (Alaska Standard Time)', | |
'America/Juneau' => '(GMT-9:00) America/Juneau (Alaska Standard Time)', | |
'America/Nome' => '(GMT-9:00) America/Nome (Alaska Standard Time)', | |
'America/Yakutat' => '(GMT-9:00) America/Yakutat (Alaska Standard Time)', | |
'America/Dawson' => '(GMT-8:00) America/Dawson (Pacific Standard Time)', |
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\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Storage; | |
class ChunkUploadController extends Controller | |
{ | |
private function storage() |
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 FileDrop(props) { | |
const [drag, setDrag] = React.useState(false); | |
const [filename, setFilename] = React.useState(''); | |
let dropRef = React.createRef(); | |
let dragCounter = 0; | |
const handleDrag = e => { | |
e.preventDefault(); | |
e.stopPropagation(); | |
}; |
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\Providers; | |
use App\Models\User; | |
use App\Observers\UserObserver; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ |
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 | |
/** | |
* Description of VideoStream | |
* | |
* @author Rana | |
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial | |
*/ | |
class VideoStream | |
{ | |
private $path = ""; |
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\Http; | |
/** | |
* Description of VideoStream | |
* | |
* @author Rana | |
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069 | |
*/ |