Skip to content

Instantly share code, notes, and snippets.

😋
Coding

Khoa Hoang htxuankhoa

😋
Coding
Block or report user

Report or block htxuankhoa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@BenSampo
BenSampo / deploy.sh
Last active Mar 24, 2020
Laravel deploy script
View deploy.sh
# Change to the project directory
cd /home/forge/domain.com
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin master
@zabaala
zabaala / BindDatabaseServiceProvider.php
Last active Aug 24, 2018
php artisan db:log <start> <stop>
View BindDatabaseServiceProvider.php
<?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
ENV DEBCONF_NONINTERACTIVE_SEEN=true
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">
<head>
<title>Subscriptions - freek@spatie.be</title>
</head>
<body>
<outline text="PHP" title="PHP">
<outline htmlUrl="http://frederickvanbrabant.com" title="frederickvanbrabant.com" xmlUrl="http://frederickvanbrabant.com/feed.xml" type="rss" text="frederickvanbrabant.com"/>
<outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/>
<outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/>
@timwhitlock
timwhitlock / disable-wp-json.php
Created Feb 11, 2017
Disable WordPress REST API completely
View disable-wp-json.php
<?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 ) );
} );
@tschaeff
tschaeff / 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">
<head>
<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="https://js.stripe.com/v2/"></script>
</head>
<body>
@odan
odan / xampp_php7_xdebug.md
Last active Apr 1, 2020
Installing Xdebug for XAMPP
View xampp_php7_xdebug.md
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active Mar 21, 2020
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme
View ubuntu_agnoster_install.md

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

View LaravelInterviewQuestions.md

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
martinbuberl / sublime-command-line.md
Last active Mar 22, 2020 — forked from adrianorsouza/sublime-command-line.md
Launch Sublime Text from the command line on OSX
View sublime-command-line.md

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.

Requirements

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

Setup

You can’t perform that action at this time.