Skip to content

Instantly share code, notes, and snippets.

@souravmsh
souravmsh / image_xoom.html
Last active January 8, 2025 07:10
zoom in an image
<img class="img-fluid w-100 h-100" data-xoom="true" alt="Sample1" src="https://picsum.photos/400/400">
<img class="img-fluid w-100 h-100 xoom" alt="Sample2" src="https://picsum.photos/400/401">
<script>
// IMAGE XOOM
// ------------------------------------------------------------
class ImageXoom {
constructor(config = {}) {
this.defaultConfig = {
selector: null, // Default selector for zoomable images
@souravmsh
souravmsh / notify-message.html
Last active January 8, 2025 07:11
Handle application notification
<div>
<a
data-notify="true"
data-notify-api-url="{{ route('dashboard.messages.notifications') }}"
data-notify-api-token="{{ auth()->user()->api_token ?? "" }}"
data-notify-api-delay="30"
data-notify-title="Message"
data-notify-count-selector="#message-count"
data-notify-list-selector="#message-list"
data-notify-list-item-class="dropdown-item pb-0"
@souravmsh
souravmsh / copy_to_clipboard.html
Last active January 8, 2025 07:11
copy to clipboard
<span class="copy">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</span>
<span data-copy="true">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</span>
<input data-copy="true" value="sometext here"/>
<textarea data-copy="true">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</textarea>
<div class="input-group">
<input id="name" type="text" class="form-control"/>
<label for="name" data-copy="true">Copy</label>
</div>
<script type="text/javascript">
@souravmsh
souravmsh / readmore.html
Last active January 8, 2025 07:11
ReadMoreJs
<span data-readmore="true">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</span>
<span class="readmore">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</span>
<span data-readmore="true" data-readmore-length="20">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</span>
<span data-readmore="true" data-readmore-length="50" data-readmore-more-button="More" data-readmore-less-button="Less" data-readmore-suffix="....">Lorem Ipsum
@souravmsh
souravmsh / HttpJsonResponse.php
Last active June 15, 2023 16:37
Laravel Ajax Http JSON Response
<?php
namespace App\Utilities;
use Illuminate\Http\Response as IlluminateResponse;
class HttpJsonResponse
{
protected static $statusCode = IlluminateResponse::HTTP_OK;
<?php
$tr = new ResourceTracker;
echo $tr->get($_REQUEST);
class ResourceTracker
{
public function __construct()
<h1>Microwave Oven - Time Countdown</h1>
Set Timer <input type="number" name="time" value="10" min="0"> seconds
<button type="button">Get recipe!</button>
<br/>
<br/>
<textarea rows="4" cols="50"></textarea>
<script>
class Microwave {
<?php
function base64_upload($data = "", $upload_dir = "")
{
if (!empty($data))
{
$decodeData = base64_decode($data);
$mime = finfo_buffer(finfo_open(), $decodeData, FILEINFO_MIME_TYPE);
$extension = allowedExtension($mime);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.copyBtn').click(function(){
copyToClipboard('.copyTxt');
$(this).text('Copied...');
history.go(0);
});
<script type="text/javascript">
var frm = document.createElement('iframe');
frm.setAttribute('src', 'http://api.sebaghar.com/hospital/1');
frm.setAttribute('width', '100%');
frm.setAttribute('height', '100%');
frm.setAttribute('frameborder', '0');
frm.setAttribute('scrolling', 'no');
frm.setAttribute('onload', 'resizeIframe(this)');
document.write('<div id="s384gh4r"></div>');
document.getElementById('s384gh4r').appendChild(frm);