Skip to content

Instantly share code, notes, and snippets.

php artisan config:cache
php artisan config:clear
@scgupta208
scgupta208 / Babjan Code
Created March 15, 2019 06:30
Babjan show more less code
css code
.blog{
max-height: 600px;
background: aqua;
}
Html Code
<div class="container">
====================================================================
controller.php
===========
public function graphiQl() {
$shop = User::where('id', '=', "1")->get()->first();
if ($shop) {
$shop_id = $shop->id;
$shop_name = $shop->shop_domain;
$shop_token = $shop->token;
@scgupta208
scgupta208 / install mongo
Last active May 30, 2019 08:42
Install mongo in aws server
1. Follow this link to install mongo "https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-amazon/".
2. After installaion paste this command "sudo service mongod restart".
3. After that write command "mongo" in the terminal
4. Then create user by this command "db.createUser({user:'user',pwd:'pwd',roles:[{role:'readWrite',db:'dbname'}]})".
4.1}. press ctrl+z.
5. Then you can connect your mongodb terminal via this command "mongo --port 27017 -u "user" -p "pwd" --authenticationDatabase "admin" ".
install pecl for mongodb driver
@scgupta208
scgupta208 / css design
Created October 13, 2017 05:23
Check Box design Shape like input type
=============HTML====================
<input type="checkbox" id="test1" />
<label for="test1">
<div class="text">Red</div></label>
</p>
<br>
<p>
<input type="checkbox" id="test2" checked="checked" />
===================[Html Code]==================================================
<form id="upload_image" method="post" enctype="multipart/form-data">
<input class="form-control" name="artistImage" type="file" id="artist_image">
<input class="form-control" name="bannerImage" type="file" id="banner_image">
<input type="submit" id="uploadButton" value="Upload Image" class="btn btn-primary black_button">
</form>
=====================[JS]=======================================================
***************************
1.How to get wishlist data
***************************
------API---------
getWishlistDetails
----Parameter----------
action*
***************************
1.How to get wishlist data
***************************
------API---------
getWishlistDetails
----Parameter----------
action*
@scgupta208
scgupta208 / SQL
Created August 9, 2017 12:00
how to import sql file larger then 100 mb or more ?
==> first go throw your your database where it is located
use command [zcat eatcake_app.sql.gz | mysql -u 'root' -p eatcake_app]
<?php
$size="small";
$filename="https://cdn.shopify.com/s/files/1/0324/1549/products/httpstatic.bigshoes.comimagesmodel_images7737xl.jpg?v=1496059618";
$imageU=imgUrl($filename,$size);
echo $imageU;
function imgUrl($filename,$size){
$extension_pos = strrpos($filename, '.'); // find position of the last dot, so where the extension starts
$thumb = substr($filename, 0, $extension_pos) ."_".$size . substr($filename, $extension_pos);
return $thumb;