Skip to content

Instantly share code, notes, and snippets.


Khoa Hoang htxuankhoa

View GitHub Profile
BenSampo /
Last active Oct 22, 2020
Laravel deploy script
# Change to the project directory
cd /home/forge/
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin master
zabaala / BindDatabaseServiceProvider.php
Last active Aug 13, 2020
php artisan db:log <start> <stop>
View BindDatabaseServiceProvider.php
namespace App\Commands\Database;
use Illuminate\Support\ServiceProvider;
class BindDatabaseServiceProvider extends ServiceProvider
public function boot()
View Dockerfile
FROM php:7.1-apache
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -q \
&& apt-get install unzip git libicu-dev curl libcurl4-gnutls-dev libmcrypt-dev -y --no-install-recommends
RUN docker-php-ext-install intl sockets curl pdo_mysql \
# xdebug is installed, but not enabled
View subscriptions.opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<title>Subscriptions -</title>
<outline text="PHP" title="PHP">
<outline htmlUrl="" title="" xmlUrl="" type="rss" text=""/>
<outline htmlUrl="" title="" xmlUrl="" type="rss" text=""/>
<outline title="" xmlUrl="" type="rss" text=""/>
timwhitlock / disable-wp-json.php
Created Feb 11, 2017
Disable WordPress REST API completely
View disable-wp-json.php
* Plugin Name: Disable REST API
* Version: 0
// completely disable wp-json access
add_filter( 'rest_authentication_errors', function( $access ){
return new WP_Error( 'rest_cannot_access', 'Bye', array( 'status' => 403 ) );
} );
thorwebdev / stripe_one_time_charge.php
Last active Aug 11, 2019
Best practice example for creating one time charges using Stripe.js and Stripe's PHP bindings without creating customer objects.
View stripe_one_time_charge.php
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>One Time Charge</title>
<script type="text/javascript" src=""></script>
odan /
Last active Oct 27, 2020
Installing Xdebug for XAMPP
renshuki /
Last active Oct 26, 2020
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH


Laravel 5 Interview Questions

This is a compiled list of Laravel interview questions. If Laravel is an engineer's PHP framework of choice, they definitely have potential to be a good candidate, but a lot of new PHP engineers have been into Laravel too. The framework itself is very welcoming to newcomers, which makes it easy for beginners to feel that they know more than they really do.

General Questions

1. How long have you been using Laravel?

This question can help decide what level of questions to ask.

martinbuberl /
Last active Sep 30, 2020 — forked from adrianorsouza/
Launch Sublime Text from the command line on OSX

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.


  • Sublime text 2 or 3 installed in your system within Applications folder


You can’t perform that action at this time.