Skip to content

Instantly share code, notes, and snippets.

View PsKs's full-sized avatar

PSK PsKs

  • 21:35 (UTC +07:00)
View GitHub Profile

Basic Vi Commands

Modes & Controls

Command Description
vi filename Edit filename
vi -r filename Edit last version of filename after crash
vi + n filename Edit filename at end of file
vi + filename Edit filename at end of file

Install Laravel 5 through Composer

First install Composer, then:

$ composer create-project laravel/laravel <project-name>

After that we can start a webserver, and test the default index page:

# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml
@PsKs
PsKs / README-Template.md
Created May 14, 2017 11:22 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@PsKs
PsKs / README.md
Created June 14, 2017 10:53 — forked from magnetikonline/README.md
Reset Windows 2012R2 local administrator password.

Reset Windows 2012R2 local administrator password

  • Boot from Microsoft Windows Server 2012R2 DVD/ISO.
  • From the Windows Setup menu, click "Next".
  • Select "Repair your computer".
  • Click on "Troubleshoot".
  • Under Advanced options, click "Command Prompt".

At the command prompt, run the following commands:

@PsKs
PsKs / GoogleDriveServiceProvider.php
Created June 23, 2017 14:17 — forked from ivanvermeyen/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
@PsKs
PsKs / homestead-manual-install.md
Created July 17, 2017 14:37 — forked from idecardo/homestead-manual-install.md
Laravel Homestead Manual Installation

Getting Started

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. Read more...

Download

Download homestead box using this link:

@PsKs
PsKs / How to Implement Client Model Observer for Laravel Passport Custom IDs.txt
Created February 11, 2018 19:17
[See How to Implement.txt below] This Gist shows how to implement a Client model observer for Laravel Passport so that you don't have to be stuck with that weird autoincrementing Client ID.
This Gist provides an example of how to implement a Client Model Observer for Laravel Passport.
This Observer will allow you to intercept the creation of a `Laravel\Passport\Client` model and set a custom id for it.
However, to implement this, you will need to handle the migrations yourself. In my case, the custom ID will be a random, large integer. So the database migrations set the `id` field to a type of `bigInteger`.
Take a look at this complete Gist carefully and implement it yourself. It's very easy.
@PsKs
PsKs / 1README.md
Created February 23, 2018 14:14 — forked from joseluisq/1README.md
How add a custom field to Laravel 5.4 default login. LoginController.php

How add a custom field to Laravel 5.4 default login controller.

In this php example (app/Http/Controllers/Auth/LoginController.php) my model is called Client and the custom field for login validation is status. (Client->status)

Add in your resources/lang/en/auth.php file :

    'failed_status' => 'Your account is inactive yet. Please confirm your e-mail address.',