Skip to content

Instantly share code, notes, and snippets.

View tridungpham's full-sized avatar

Pham Tri Dung tridungpham

View GitHub Profile
@tridungpham
tridungpham / Laravel-Container.md
Created June 8, 2018 10:22
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Accessing the Container

@tridungpham
tridungpham / vietnamese.rules
Created March 7, 2021 10:22 — forked from hieunguyentrung/vietnamese.rules
PostgreSQL unaccent Vietnamese rules
À A
Á A
Ả A
Ạ A
 A
Ấ A
Ầ A
Ẩ A
Ậ A
Ẫ A
@tridungpham
tridungpham / php7.4-fpm-alpine
Created June 12, 2021 13:04 — forked from jpswade/php7.4-fpm-alpine
PHP 7.4 PHP-FPM Alpine with core extensions gd
FROM php:7.4-fpm-alpine
# @see https://hub.docker.com/r/jpswade/php7.4-fpm-alpine
MAINTAINER Agent Software <[email protected]>
# Install gd, iconv, mbstring, mysql, soap, sockets, zip, and zlib extensions
# see example at https://hub.docker.com/_/php/
RUN apk add --update \
$PHPIZE_DEPS \
freetype-dev \
git \
@tridungpham
tridungpham / Flutter Development on Windows with IntelliJ and WSL.md
Created July 7, 2021 16:10
Flutter Development on Windows with IntelliJ and WSL

Developing Flutter apps using Windows

I've been developing Flutter apps for two years, and until this month did so exclusively on OS X. I decided to move my development environment entirely to Windows, troubled by Apple's recent behavior with the App Store, put off by being forced to buy an overpriced Mac to develop apps for iOS, and tired of wrestling with OS X's non-standard BSD-like Linux environment and Homebrew package manager. This document describes the various approaches I tried, and how to set up the one I liked the best.

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@tridungpham
tridungpham / .zshrc
Created July 7, 2022 08:40
Configuring word jumping for kitty & iterm2
# this config is for zsh
# iterm
bindkey "\e\e[D" backward-word # ⌥←
bindkey "\e\e[C" forward-word # ⌥→
# kitty
bindkey "\e[1;3D" backward-word # ⌥←
bindkey "\e[1;3C" forward-word # ⌥→
@tridungpham
tridungpham / 5000.md
Created September 15, 2022 07:57
5000+ common words created as flashcards in logseq

type:: flashcards tags:: english, english learning

  • false #card
    • Phonetics:
      • /fɒls/ audio
      • /fɑls/ audio
    • Meanings:
      • noun
  • One of two options on a true-or-false test.
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>~/.fonts</dir>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
</match>
@tridungpham
tridungpham / linux-keymap-tool.md
Last active January 30, 2023 08:33
Cool repo to map caps lock to both escape & ctrl at the same time.

I used to map Caps Lock to Escape just because I never use Caps Lock at all. Recently I was interested in hhkb layout, with the CTRL key at the position of Caps Lock. And then I found this repo:

https://github.com/rvaiya/keyd

Basically, it allows mapping Caps Lock to CTRL/Escape at the same time. When hitting CAPS, it becomes ESC but when using CAPS in conjuction with other keys (like when we use CTRL-C, CTRL-V) then CAPS become CTRL.

Absolutely fantastic tool.

Learning Plan for Test Driven Development (TDD)

These learning resources primarily focus on Test Driven Development (TDD).

  • There is an emphasis on learning using PHP, Laravel and PHPUnit.
  • All these resources are free (at the time of writing)