Skip to content

Instantly share code, notes, and snippets.

View uzzalhcse's full-sized avatar

Uzzal Hosen uzzalhcse

View GitHub Profile
@uzzalhcse
uzzalhcse / vuejs_event_modifier.js
Created July 3, 2022 04:58
vue js event modifiers
<!-- the click event's propagation will be stopped -->
<a @click.stop="doThis"></a>
<!-- the submit event will no longer reload the page -->
<form @submit.prevent="onSubmit"></form>
<!-- modifiers can be chained -->
<a @click.stop.prevent="doThat"></a>
<!-- just the modifier -->
@uzzalhcse
uzzalhcse / awake.py
Created October 3, 2021 15:50 — forked from wbhinton/awake.py
Python Script to keep your screen alive
import pyautogui
import time
import sys
from datetime import datetime
pyautogui.FAILSAFE = False
numMin = None
print('We will keep you computer awake by moving the mouse every 3 minutes. ¯\_(ツ)_/¯')
if ((len(sys.argv)<2) or sys.argv[1].isalpha() or int(sys.argv[1])<1):
numMin = 3

Microsoft Windows and Office KMS Setup

@uzzalhcse
uzzalhcse / windows10activation
Created July 13, 2021 09:52 — forked from amanjuman/windows10activation
Activate Windows 10 without Any Activator
1. Open CMD as Administrator
2. Paste the following commands into the Cmd: One by one, follow the order.
cscript slmgr.vbs /ipk "SERIAL NUMBER HERE"
Replace SERIAL NUMBER HER with any of these, according your Windows 10 installation type.
Home/Core TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Home/Core (Country Specific) PVMJN-6DFY6-9CCP6-7BKTT-D3WVR
Home/Core (Single Language) 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
@uzzalhcse
uzzalhcse / async-await.js
Created October 15, 2020 05:17 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
import Auth from 'Api/Auth'
import { getToken, setToken, removeToken } from '@/utils/auth'
import router, { resetRouter } from '@/router'
const state = {
token: getToken(),
name: '',
roles: [],
info: {
roles: []
@uzzalhcse
uzzalhcse / multipleFileUpload.vue
Created October 15, 2020 05:06
Multiple file upload with Vue and Axios
<style>
input[type="file"]{
position: absolute;
top: -500px;
}
div.file-listing{
width: 200px;
}
span.remove-file{
color: red;
@uzzalhcse
uzzalhcse / passwordValidation.php
Created October 15, 2020 05:00
Laravel Password validation Regex (Contain at least one uppercase/lowercase letters and one number)
<?php
/*
* Place this with the rest of your rules.
* Doesn't need to be in an array as there are no pipes.
* Password is required with a minimum of 6 characters
* Should have at least 1 lowercase AND 1 uppercase AND 1 number
*/
$rules = [
'password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/'
];
@uzzalhcse
uzzalhcse / disable-right-click-images.js
Created October 15, 2020 04:57
Prevent right click on image
/*
* This script will look for all images on a page and prevent right clicking on an image.
*/
const images = document.getElementsByTagName('img');
for(var i = 0; i < images.length; i++) {
images[i].addEventListener('contextmenu', event => event.preventDefault());
}
@uzzalhcse
uzzalhcse / App\Exceptions\Handler.php
Created October 15, 2020 04:55
laravel Exception handle for api
<?php
namespace App\Exceptions;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Validation\ValidationException;
use Throwable;