Skip to content

Instantly share code, notes, and snippets.

View anhdiepmmk's full-sized avatar

PHẠM NGỌC ĐIỆP anhdiepmmk

View GitHub Profile
@anhdiepmmk
anhdiepmmk / Dockerfile
Created May 23, 2022 13:36 — forked from BretFisher/Dockerfile
WIP sample Laravel php_fpm plus nginx plus supervisor Docker setup with npm, composer, bower, and more
FROM yourdockername/base-php-nginx:latest AS build
# BUILD STAGE
# the primary reason we have two build stages is so SSH key of private repo's will never
# be in final image
# COPY IN BUILD SSH KEY
# It won't be copied to final image
# add this build arg to compose file
ARG BUILDKEY
RUN if [ -z "$BUILDKEY" ]; then echo "BUILDKEY SSH NOT SET - ERROR"; exit 1; else : ; fi
@anhdiepmmk
anhdiepmmk / tmux.conf
Created May 15, 2022 17:02 — forked from rajanand02/tmux.conf
Tmux configurations with status bar theme
# set prefix to control-f
set -g prefix C-f
#unbind system defined prefix
unbind C-b
# helps in faster key repetition
set -sg escape-time 0
# start session number from 1 rather than 0
@anhdiepmmk
anhdiepmmk / doom.txt
Created March 4, 2022 04:54 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@anhdiepmmk
anhdiepmmk / README.md
Created February 28, 2022 04:34 — forked from martinklepsch/README.md
A very minimal Emacs configuration to get started with Emacs & Evil-mode

A Starting Point for using Emacs & Evil-mode

(I wrote a bit about why Emacs and Vim on my blog and thought it might be nice to give some starting point for people that want to try it.)

If you just want to play around with Emacs & Evil mode do the following:

  1. mkdir ~/.emacs.d/
  2. copy init.el into ~/.emacs.d/
  3. Download Emacs from http://emacsformacosx.com
@anhdiepmmk
anhdiepmmk / page-info.ts
Created February 25, 2022 12:41 — forked from tumainimosha/page-info.ts
NestJS Graphql Cursor Based pagination
import { ObjectType, Field } from "@nestjs/graphql";
@ObjectType()
export class PageInfo {
@Field({ nullable: true })
startCursor: string;
@Field({ nullable: true })
endCursor: string;
@anhdiepmmk
anhdiepmmk / vim-maps.vim
Created January 3, 2022 12:28 — forked from jcmuller/vim-maps.vim
Useful vim key mappings
""""""""""""""""""""""""
" Useful maps
""""""""""""""""""""""""
" Map <C-L> (redraw screen) to also turn off search highlighting until the
" next search
nnoremap <C-L> :nohl<CR><C-L>
" Don't use arrow keys
map <up> <nop>
map <down> <nop>

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@anhdiepmmk
anhdiepmmk / Dockerfile
Created October 31, 2019 12:56 — forked from shov/Dockerfile
Docker PHP 7.2 fpm with GD jpg, png suppot
FROM php:7.2-fpm
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# make sure apt is up to date
RUN apt-get update --fix-missing
RUN apt-get install -y curl
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev
@anhdiepmmk
anhdiepmmk / php-docker-ext
Last active October 22, 2019 04:13 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@anhdiepmmk
anhdiepmmk / OkHttpProgressGlideModule.java
Created September 8, 2017 06:35 — forked from TWiStErRob/OkHttpProgressGlideModule.java
Full POC for showing progress of loading in Glide v3 via OkHttp v2
// TODO add <meta-data android:value="GlideModule" android:name="....OkHttpProgressGlideModule" />
// TODO add <meta-data android:value="GlideModule" tools:node="remove" android:name="com.bumptech.glide.integration.okhttp.OkHttpGlideModule" />
// or not use 'okhttp@aar' in Gradle depdendencies
public class OkHttpProgressGlideModule implements GlideModule {
@Override public void applyOptions(Context context, GlideBuilder builder) { }
@Override public void registerComponents(Context context, Glide glide) {
OkHttpClient client = new OkHttpClient();
client.networkInterceptors().add(createInterceptor(new DispatchingProgressListener()));
glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client));
}