Skip to content

Instantly share code, notes, and snippets.

View pradeep3's full-sized avatar
🌟
Creating apps

PradeepKumar K pradeep3

🌟
Creating apps
View GitHub Profile
@pradeep3
pradeep3 / vimrc
Last active November 25, 2022 08:08
This is my Vimrc file
" Plugin Loading
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim' "Highlights lines
Plug 'joshdick/onedark.vim' "The One Dark Theme
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' "Fuzzy find plugin
Plug 'junegunn/goyo.vim' "Removes Line numbers for focusing
Plug 'mbbill/undotree' "Creates an undo tree
Plug 'preservim/nerdtree' "File browser inside vim
Plug 'godlygeek/tabular' "Auto formatting
#!/bin/bash
# PhalconPhp with PHP7 installation on ubuntu:16.04
sudo apt-get update
sudo apt-get install -y php7.0-fpm \
php7.0-cli \
php7.0-curl \
php7.0-gd \
<?php namespace App\Http\Middleware;
// First copy this file into your middleware directoy
use Closure;
class CheckRole{
/**
* Handle an incoming request.
@pradeep3
pradeep3 / .zshrc
Last active November 25, 2022 08:09
ohMyZsh Installation instruction for ubuntu with sample .zshrc file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
@pradeep3
pradeep3 / AuthServiceProvider.php
Last active October 21, 2019 11:56
Password route only for access tokens
<?php
public function boot() {
Passport::routes(function ($router){
$router->forAccessTokens();
});
}
?>
The tutorial Getting URL Parameters with Javascript explained how you can get url parameters with the URL and URLSearchParams objects. This tutorial explains how you can change a url - edit a parameter, add a new parameter or delete one.
Editing a Parameter
The set method of the URLSearchParams object sets the new value of the parameter.
After setting the new value you can get the new query string with the toString() method. This query string can be set as the new value of the search property of the URL object.
The final new url can then be retrieved with the toString() method of the URL object.
var url = new URL('http://demourl.com/path?id=100&topic=main');
@pradeep3
pradeep3 / HasUuid.php
Created September 30, 2021 16:03 — forked from calebporzio/HasUuid.php
A little trait to add to models that will have Uuids
<?php
// Example usage in a model:
class ExampleModel extends Model
{
use HasUuid;
protected $primaryKey = 'uuid';