Skip to content

Instantly share code, notes, and snippets.

View vrajroham's full-sized avatar
🏠
Working from home

Vaibhavraj Roham vrajroham

🏠
Working from home
View GitHub Profile
trait AlexaAuthorization{
public function parseToken($token)
{
$key_path = Passport::keyPath('oauth-public.key');
$this->parseTokenKey = file_get_contents($key_path);
$token = (new Parser())->parse((string) $token);
$signer = new Sha256();
if ($token->verify($signer, $this->parseTokenKey)) {
$userId = $token->getClaim('sub');
@vrajroham
vrajroham / Laravel PHP7 LEMP AWS.md
Created April 28, 2018 06:40 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@vrajroham
vrajroham / laravel-supervisor.md
Last active December 1, 2023 01:55
Installing Supervisor on AWS EC2 and Beanstalk

Installing Supervisor on AWS EC2 and Beanstalk

This gist may help you to install supervisor Manually on AWS Beanstalk host. I was enable to install and configure referring supervisor docs. Here are the steps by which I was able to use supervisor on my project.

Note: I have performed this steps on Laravel project and my instance was Debian powered. You can change according to your requirement.


  • Check python with easy_install is installed
  • Install supervisor > $ easy_install supervisor
  • Create directory for supervisor workers > mkdir /etc/supervisor/conf.d/
  • Create laravel worker file > touch /etc/supervisor/conf.d/laravel-worker.conf
@vrajroham
vrajroham / 01_Laravel 5 Simple ACL manager_Readme.md
Created November 28, 2016 11:40 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@vrajroham
vrajroham / API.md
Created November 23, 2016 14:47 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@vrajroham
vrajroham / s3link-v4.php
Created November 11, 2016 06:45 — forked from kelvinmo/s3link-v4.php
PHP code to generate a pre-signed URL to access a restricted AWS S3 object
@vrajroham
vrajroham / visor-archivos-online.md
Created October 5, 2016 10:43 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
@vrajroham
vrajroham / IndianStates.json
Created March 29, 2016 07:16 — forked from shubhamjain/IndianStates.json
Indian States and Union Territories in JSON format
{
"AP":"Andhra Pradesh",
"AR":"Arunachal Pradesh",
"AS":"Assam",
"BR":"Bihar",
"CG":"Chhattisgarh",
"Chandigarh":"Chandigarh",
"DN":"Dadra and Nagar Haveli",
"DD":"Daman and Diu",
"DL":"Delhi",