Skip to content

Instantly share code, notes, and snippets.

View lanphan's full-sized avatar

Lan Phan lanphan

  • Ho Chi Minh - Vietnam
View GitHub Profile
@lanphan
lanphan / xdebug.sh
Created March 24, 2022 22:42 — forked from carstenwindler/xdebug.sh
Bash script to quickly enable / disable xdebug in a PHP docker container
#!/usr/bin/env bash
# see https://carstenwindler.de/php/enable-xdebug-on-demand-in-your-local-docker-environment/
if [ "$#" -ne 1 ]; then
SCRIPT_PATH=`basename "$0"`
echo "Usage: $SCRIPT_PATH enable|disable"
exit 1;
fi
# Expects service to be called app in docker-compose.yml
@lanphan
lanphan / laravel_conditional_index_migration.php
Last active October 23, 2021 09:43 — forked from Razoxane/laravel_conditional_index_migration.php
Laravel - Create Index If Not Exists / Drop Index If Exists
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LaravelConditionalIndexMigration extends Migration
{
/**
* Run the migrations.
@lanphan
lanphan / steve-yegge-google-platform-rant.md
Created October 11, 2021 16:46 — forked from kislayverma/steve-yegge-google-platform-rant.md
A copy (for posterity) of Steve Yegge's internal memo in Google about what platforms are and how Amazon learnt to build them

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engineers pretty much do everything,

@lanphan
lanphan / self-hosted-email-server.md
Created April 14, 2017 09:36 — forked from F1LT3R/self-hosted-email-server.md
Self-Hosted Email Server

#Self-Hosted Email Server

This guide shows you how to set up a self-hosted email server.

##The Stack

Stack Diagram

###At The Core