Skip to content

Instantly share code, notes, and snippets.

View ErMandeep's full-sized avatar
🎯
Focusing

Mandeep Singh ErMandeep

🎯
Focusing
View GitHub Profile
@ErMandeep
ErMandeep / install laravel with livewire
Created February 21, 2021 10:01
install laravel with livewire
# install composer
composer global require laravel/installer
# composer create-project laravel/laravel laravel-cms
# composer require laravel/jetstream
# php artisan jetstream:install livewire --teams
@ErMandeep
ErMandeep / last 7 days, last 2 weeks and last 30 days in php
Created January 8, 2021 05:18
last 7 days, last 2 weeks and last 30 days in php
<?php
if( !function_exists( 'pr' ) ) {
function pr() {
foreach( func_get_args() as $e ) {
echo "<pre>";
print_r( $e );
echo "</pre>";
}
@ErMandeep
ErMandeep / helper functions
Created December 23, 2020 05:37
helper functions
if( !function_exists( 'pr' ) ) {
function pr() {
foreach( func_get_args() as $e ) {
echo "<pre>";
print_r( $e );
echo "</pre>";
}
}
}
@ErMandeep
ErMandeep / how to import large sql file in xamp by a command
Last active January 20, 2021 11:16
how to import large sql file in xamp by a command
there is two command
before run command increase the size of
max_allowed_packet to 1072731894
or
SET GLOBAL max_allowed_packet=1072731894
@ErMandeep
ErMandeep / orintation.php
Created November 30, 2020 12:42
stop image rotation => upload image using url in php
$exif = exif_read_data($url);
if (!empty($exif['Orientation'])) {
$imageResource = imagecreatefromjpeg($url); // provided that the image is jpeg. Use relevant function otherwise
switch ($exif['Orientation']) {
case 3:
$image = imagerotate($imageResource, 180, 0);
break;
case 6:
$image = imagerotate($imageResource, -90, 0);
@ErMandeep
ErMandeep / select chosen option using jquery
Created November 24, 2020 07:18
select chosen option using jquery
select chosen multiple value using id
$("#herb_cat1").val(["product", "premix"]).trigger("liszt:updated");
select chosen single value using id
$("#herb_cat1").val(["product"]).trigger("liszt:updated");
@ErMandeep
ErMandeep / index.html
Created November 18, 2020 17:50
UI box
<section class="container">
<section class="one">
<div class="logo">
<img src="https://image.flaticon.com/icons/svg/143/143361.svg">
</div>
<h2 class="heading">
please subscribe to get updates
</h2>
<p> signup with your email to get latest updates
</p>
@ErMandeep
ErMandeep / sendinblue email by curl
Created November 17, 2020 17:53
sendinblue email by curl
<?php
$data = array(
"sender" => array(
"email" => '[email protected]',
"name" => 'sender email'
),
"to" => array(
@ErMandeep
ErMandeep / single_lot.php
Created November 10, 2020 10:19
single_lot.php
<style>
.buttons-csv{
background: #ffb848 !important;
color: #fff !important;
font-weight: bold;
font-size: 13px !important;
}
#inventoryLot .modal-dialog { width: 600px; }
div#DataTables_Table_0_length { margin-right: 28px; }
.report_filter_div {margin-bottom: 40px; margin-top: 40px; }
@ErMandeep
ErMandeep / invLevelSearchForAll.php
Created November 10, 2020 10:19
invLevelSearchForAll.php
<div class="portlet">
<div class="portlet-body">
<div class="">
<!--<div class="span12s m-l-10 m-r-10">-->
<form id="lowStockForm" action="<?php echo make_admin_url('inventory_updated', 'inventory_levels', 'inventory_levels'); ?>" >
<!-- <input type="hidden" name="Page" value="inventory_updated"/>
<input type="hidden" name="action" value="inventory_levels"/>
<input type="hidden" name="section" value="inventory_levels"/>
<input type="hidden" name="stype" value="<?= $stype ?>"/>