Skip to content

Instantly share code, notes, and snippets.

View puncoz's full-sized avatar
🇳🇵
Working from home

Puncoz Nepal puncoz

🇳🇵
Working from home
View GitHub Profile
@puncoz
puncoz / useApi.js
Last active June 30, 2022 05:16
useApi.js
"use strict"
import Http from "axios"
import _get from "lodash/get"
import qs from "qs"
import { inject } from "vue"
import useCache from "./useCache"
import useNotification from "./useNotification"
export default () => {
const cache = useCache()
@puncoz
puncoz / NepaliDatePicker.vue
Created June 20, 2022 08:16
Nepali Date Picker for Vue.js
<template>
<input :id="id"
type="text"
:value="date"
class="form-control date-picker-bs"
:placeholder="placeholder">
</template>
<script type="text/ecmascript-6">
import { mapGetters } from "vuex"
@puncoz
puncoz / PDFEditor.vue
Created May 7, 2022 11:43
Blur PDF using canvas rectangle.
<template>
<div class="wrapper">
<canvas id="pdf-doc" ref="canvasRef"/>
</div>
</template>
<script type="text/ecmascript-6">
import * as pdfJsLib from "pdfjs-dist/build/pdf"
import pdfJsWorker from "pdfjs-dist/build/pdf.worker.entry"
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
<template>
<modal :show="show"
modal-class="flex justify-center items-center"
max-width="sm"
:closeable="closeable"
@close="$emit('cancelled')">
<div class="px-6 py-4">
<div class="text-lg">
<slot name="title"/>
</div>
@puncoz
puncoz / NotificationItem.vue
Created October 14, 2021 11:15
Notification in vue3
<template>
<div class="flex items-center rounded p-3 shadow-md mb-2 w-64"
:class="{
'bg-green-500' : notification.type === 'success',
'bg-red-500' : notification.type === 'error',
'bg-yellow-500' : notification.type === 'warning',
'bg-blue-500' : notification.type === 'info',
'bg-primary-500' : notification.type === 'message',
}">
<div class="flex-1 flex items-center">
@puncoz
puncoz / Notification.php
Created August 31, 2020 08:51
FCM Notification
<?php
namespace App\Notification;
use App\Exceptions\FcmKeyNotSetException;
use GuzzleHttp\Client;
/**
* Class Notification
* @package App\Notification
@puncoz
puncoz / docker-commands.md
Last active March 10, 2020 10:15
Useful Docker Commands

Useful Docker Commands

Show docker disk usage

docker system df

# With verbose
docker system df -v

Basic NVM Commands

Repo:

https://github.com/nvm-sh/nvm

To download, compile, and install the latest release of node, do this:

nvm install node # "node" is an alias for the latest version
@puncoz
puncoz / gh-pages-deploy.md
Created December 1, 2019 16:40 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).