Skip to content

Instantly share code, notes, and snippets.

@shahednur
shahednur / Response.php
Created December 10, 2021 13:37 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?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;
@shahednur
shahednur / react-authentication-folder-structure.md
Created February 3, 2022 17:40 — forked from mksglu/react-authentication-folder-structure.md
React JS Authenatication Folder Structure

React JS Authenatication + REST API

Used Packages

  • React JS
  • Redux Thunk
  • Redux Form
  • Redux Logger
Front-end Audit
Use this document as a basis for outlining and planning your front-end build.
You can initially fill this out before the build of your front-end, and then update it as you move through to have an at-a-glance list of information that you can constantly evaluate.
Info
Name, URL, additional site-specific info.
Site: [Site Name]
URL: http://www.example.com
@shahednur
shahednur / tailwind.config.js
Last active February 19, 2022 21:00
tailwind.config.js
module.exports = {
prefix: '',
important: false,
separator: ':',
theme: {
screens: {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
@shahednur
shahednur / Nice Route Collections:
Created February 9, 2019 04:18
Laravel Route Group Collections
=========================
======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 (){});
@shahednur
shahednur / User.php
Created August 22, 2022 05:26
Laravel Eloquent Model Accessor to get Client/User IP Address
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);
@shahednur
shahednur / movie-streaming-apps-activity.txt
Created September 3, 2023 15:43
Prompt: in a movie streaming flutter android app, which kind of activity a user can do, give that list of activity.
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