Skip to content

Instantly share code, notes, and snippets.

View shrestharikesh's full-sized avatar
🎯
Focusing

Rikesh Shrestha shrestharikesh

🎯
Focusing
View GitHub Profile
@shrestharikesh
shrestharikesh / markdown.md
Created November 22, 2021 16:15
markdown Cheatsheet

Heading level 1

Heading level 2

Heading level 3

Heading level 4

Heading level 5
@shrestharikesh
shrestharikesh / commands on local machine after server setup
Last active September 21, 2020 04:49
Automatic deployment with GIT in a VPS. Create a git hook on VPS.
cd /my/workspace
mkdir project && cd project
git init
git remote add live ssh://user@mydomain.com/var/repo/site.git
git add .
git commit -m "My project is ready"
git push live master
@shrestharikesh
shrestharikesh / gitcommands.md
Last active September 6, 2020 09:54
Collection of some advanced git commands

Advanced Git Commands

  1. To ignore unstaged changes: git commit -- .

  2. To stop tracking a file or folder that was added earlier but later added to .giignore:
    git rm --cached <file>
    git rm -r --cached <folder>

    WARNING: While this will not remove the physical file from your local,
    it will remove the files from other developers machines on next git pull.
@shrestharikesh
shrestharikesh / Html Bootstrap Invoice Template
Last active March 16, 2020 05:58
Printable Invoice design with bootstrap 4
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Invoice</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
</head>
<body>
@shrestharikesh
shrestharikesh / helper.php
Created September 18, 2019 02:47
Helpful Laravel Custom Helper Functions
<?php
/**
* case insensetive filter for collection
*/
if (!function_exists('collectionFilter')) {
function collectionFilter($collection,$attribute,$value)
{
return $collection->filter(function ($item) use ($attribute, $value) {
@shrestharikesh
shrestharikesh / FileUploadController.php
Last active September 1, 2020 06:21
Jquery asynchronous Image Upload on Laravel
class FileUploadController extends Controller
{
public function imageUpload(Request $request)
{
$photos = [];
foreach ($request->photos as $photo) {
$photos[] = getImageURL($photo->store('public/images'));
}
return response()->json(['files' => $photos], 200);
}
@shrestharikesh
shrestharikesh / index.html
Created July 3, 2019 16:14
inline-flex vs inline-block
<!-- <div class="flex-parent"> -->
<div id="box1-parent" class="box200">
<div id="box1-child" class="box100"></div>
</div>
<div id="box2-parent" class="box200">
<div id="box2-child" class="box100"></div>
</div>
@shrestharikesh
shrestharikesh / video-overlay-ads.html
Created June 19, 2019 04:44
overlay banner ads on HTML5 video player
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
.outer-container {
@shrestharikesh
shrestharikesh / Nepali Calendar
Last active October 8, 2023 03:30
Nepali Calendar for PHP / Laravel app
<?php
namespace App\Helpers;
class NepaliCalendar {
private $_bs = array(
0 => array(2000,30,32,31,32,31,30,30,30,29,30,29,31),
1 => array(2001,31,31,32,31,31,31,30,29,30,29,30,30),
2 => array(2002,31,31,32,32,31,30,30,29,30,29,30,30),
3 => array(2003,31,32,31,32,31,30,30,30,29,29,30,31),