- React JS
- Redux Thunk
- Redux Form
- Redux Logger
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
Prompt: what is the process of creating that movie streaming app's models using this activity list? | |
Creating models for a movie streaming app involves defining the data structures and relationships between different entities within the app. Based on the list of activities you provided, here's a step-by-step process for creating models for a movie streaming app: | |
1. **Identify Entities:** | |
Start by identifying the main entities (objects or data structures) that will be central to your app. In this case, key entities might include: | |
- User | |
- Movie/TV Show | |
- User Profile | |
- Review |
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
public function getClientIps() | |
{ | |
$clientIps = array(); | |
$ip = $this->server->get('REMOTE_ADDR'); | |
if (!$this->isFromTrustedProxy()) { | |
return array($ip); | |
} | |
if (self::$trustedHeaders[self::HEADER_FORWARDED] && $this->headers->has(self::$trustedHeaders[self::HEADER_FORWARDED])) { | |
$forwardedHeader = $this->headers->get(self::$trustedHeaders[self::HEADER_FORWARDED]); | |
preg_match_all('{(for)=("?\[?)([a-z0-9\.:_\-/]*)}', $forwardedHeader, $matches); |
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
module.exports = { | |
prefix: '', | |
important: false, | |
separator: ':', | |
theme: { | |
screens: { | |
sm: '640px', | |
md: '768px', | |
lg: '1024px', | |
xl: '1280px', |
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 | |
// This can be found in the Symfony\Component\HttpFoundation\Response class | |
const HTTP_CONTINUE = 100; | |
const HTTP_SWITCHING_PROTOCOLS = 101; | |
const HTTP_PROCESSING = 102; // RFC2518 | |
const HTTP_OK = 200; | |
const HTTP_CREATED = 201; | |
const HTTP_ACCEPTED = 202; |
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
in database: | |
$table->enum('fruit', ['apple', 'banana', 'cantalope']); | |
in controller's construct: | |
public function __construct() | |
{ | |
DB::getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); | |
} | |
how to use this Enum in cotroller: |
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
/* | |
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
- Or, request confirmation in the process - | |
<a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
*/ | |
(function() { |
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
========================= | |
======Basic Route======== | |
========================= | |
Route::get($uri, $callback); | |
Route::post($uri, $callback); | |
Route::put($uri, $callback); | |
Route::patch($uri, $callback); | |
Route::delete($uri, $callback); | |
Route::options($uri, $callback); | |
Route::match(['get', 'post'], '/',function (){}); |
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 getVideoUrl($link){ | |
$data = explode('.mp4', $link); | |
$decode = urldecode($data[0]); | |
$linkDownload = array(); | |
$v1080p = $decode.'_hd.mp4'; | |
$v720p = $decode.'_dvd.mp4'; | |
$v360p = $decode.'_fmt1.ogv'; | |
$linkDownload['1080p'] = $v1080p; | |
$linkDownload['720p'] = $v720p; | |
$linkDownload['360p'] = $v360p; |
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
Allow display images and youtube video: | |
CSS class for links .htmllink and images .htmlimg | |
public function linkify($showimg = 1, $value, $protocols = array('http', 'mail', 'https'), array $attributes = array('target' => '_blank')) | |
{ | |
// Link attributes | |
$attr = ''; | |
foreach ($attributes as $key => $val) { | |
$attr = ' ' . $key . '="' . htmlentities($val) . '"'; | |
} |
NewerOlder