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
$page = request()->get("page") != "" ? intval(request()->get("page")) : 1; | |
$sl = ($page - 1) * 100; | |
{{ ++$sl }} |
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->paginate('Here will go your array'); | |
public function paginate($items, $perPage = 50, $page = null, $options = []) | |
{ | |
$page = $page ?: (Paginator::resolveCurrentPage() ?: 1); | |
$items = $items instanceof Collection ? $items : Collection::make($items); | |
return new LengthAwarePaginator( | |
$items->forPage($page, $perPage), | |
$items->count(), |
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 pad2(n) | |
{ | |
return (n < 10 ? '0' : '') + n; | |
} | |
var date = new Date(date goes here); | |
var month = pad2(date.getMonth()+1); | |
var day = pad2(date.getDate()); | |
var year= date.getFullYear(); |
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
var IS_SOUTH_ASIAN = true; | |
var ONES_WORD = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen']; | |
var TENS_WORD = ['', '', 'Twenty', 'Thirty', 'Fourty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety']; | |
var SCALE_WORD_WESTERN = ['', 'Thousand', 'Million', 'Billion', 'Trillion', 'Quadrillion', 'Quintillion', 'Sextillion', 'Septillion', 'Octillion', 'Nonillion']; | |
var SCALE_WORD_SOUTH_ASIAN = ['', 'Thousand', 'Lakh', 'Crore', 'Hundred Crore', 'Thousand Crore', 'Lakh Crore', 'Crore Crore', 'Hundred Crore Crore', '***', '***']; | |
var GROUP_SIZE = (typeof IS_SOUTH_ASIAN != "undefined" && IS_SOUTH_ASIAN) ? 2 : 3; | |
var SCALE_WORD = (typeof IS_SOUTH_ASIAN != "undefined" && IS_SOUTH_ASIAN) ? SCALE_WORD_SOUTH_ASIAN : SCALE_WORD_WESTERN; | |
function int_to_words(int) { | |
if (int === 0) return 'Zero'; |
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
$items = new LengthAwarePaginator( | |
$items->forPage(LengthAwarePaginator::resolveCurrentPage(), 10), | |
$items->count(), | |
10, | |
LengthAwarePaginator::resolveCurrentPage(), | |
["path" => route("home",["key" => $request->get("value") ])] | |
); |
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
$barcodes = []; | |
$from = explode("-", $request->input("from")); | |
$to = explode("-", $request->input("to")); | |
$totalDigit = strlen($from[1]); | |
$startFrom = (int) $from[1]; | |
$endTo = (int) $to[1]; |
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
// Get me all users who have posts that are to be published in the future. | |
User::whereHas('posts', function ($query) { | |
$query->where('published_at', '>', now()); | |
})->get(); | |
we can now refactor and simplify the above to the following: | |
User::whereRelation('posts', 'published_at', '>', now())->get(); | |
As you can see, we have collapsed the closure into the parameter list of the whereRelation method. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous"> | |
</head> | |
<body> | |
<div id="app" class="container mt-5"> | |
<h3 class="text-center">Bazar List</h3> |
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 printDiv(divName) { | |
var printContents = document.getElementById(divName).innerHTML; | |
var originalContents = document.body.innerHTML; | |
document.body.innerHTML = printContents; | |
window.print(); | |
document.body.innerHTML = originalContents; | |
} |
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
django-admin | |
django-admin startproject project-name | |
pyhton3 manage.py runserver |
NewerOlder