Skip to content

Instantly share code, notes, and snippets.

View pravnkay's full-sized avatar
👋

Praveen K pravnkay

👋
View GitHub Profile
@pravnkay
pravnkay / AppServiceProvider.php
Created July 27, 2018 13:42
Laravel String Length Error Fix
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
As I figured out, this question is really only related to beginners in PWA, which don't know that you can (and need) to configure PWA for achieving this. If you feel addressed now (and using VueJS) remember:
To automatically download the new content, you need to configure PWA. In my case (VueJS) this is done by creating a file vue.config.js in the root directory of my project (On the same level as package.json).
Inside this file you need this:
module.exports = {
pwa: {
@pravnkay
pravnkay / functions.php
Created December 13, 2019 09:10
Allow CORS for WP API - Along with sending Status 200 for OPTIONS request
add_action( 'init', 'handle_preflight' );
function handle_preflight() {
$origin = get_http_origin();
if ( $origin == 'http://localhost:8080' || $origin == 'https://yourapp.firebaseapp.com') {
header("Access-Control-Allow-Origin: " . $origin);
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
@pravnkay
pravnkay / Readme.md
Last active November 2, 2024 07:42
Nprogress - Loading bar for VueJS Router

Installation of Nprogress for VueJS

Install nprogress.

npm install nprogress --save


Add its CSS

@pravnkay
pravnkay / Readme.md
Last active March 14, 2020 16:12
Custom theme support for Bootstrap-Vue

Custom theme support for Bootstrap-Vue

Versions used

@vue/cli 4.1.1

Using below commands to install bootstrap-vue, adds the plugin file and pre-fills the statements. Just have alook at them and edit them

vue create my-app
cd my-app

vue add bootstrap-vue

@pravnkay
pravnkay / Readme.md
Created December 16, 2019 14:50
SweetAlert2 for VueJS

SweetAlert2 integration to VueJS

There are too many wrappers for sweetalert2 for vuejs and most of them does the same thing with less functionality.

Here is how to integrate the default SweetAlert package into VueJS

Step 1

Install SweetAlert2

@pravnkay
pravnkay / App.vue
Created December 18, 2019 14:51 — forked from bricksroo/App.vue
Reveal.js in Vue
<template>
<div id="app">
<!-- <img src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/> -->
<div class="reveal">
<div class="slides">
<section>Single Horizontal Slide</section>
<section>
<section>Vertical Slide 1</section>
<section>Vertical Slide 2</section>
@pravnkay
pravnkay / Readme.md
Created December 18, 2019 21:20
WP-API - Post by Category
@pravnkay
pravnkay / Readme.md
Last active April 15, 2020 05:52
Tailwind Admin Dashboard - Barebone

This file uses

  1. Tailwind.css
  2. Apline.js

to create a functional dashboard skeleton.

There are no UI elements. Just the Dashboard

@pravnkay
pravnkay / ModelMake.php
Created August 3, 2020 15:34
Change default directory for Models - Laravel Artisan
<?php
namespace App\Console\Commands;
use Illuminate\Foundation\Console\ModelMakeCommand;
class ModelMake extends ModelMakeCommand
{
/**
* Prefix default root namepsace with a folder.