Skip to content

Instantly share code, notes, and snippets.

View PhamBaTrungThanh's full-sized avatar

Phạm Bá Trung Thành PhamBaTrungThanh

  • Viet Nam
View GitHub Profile
@PhamBaTrungThanh
PhamBaTrungThanh / .php_cs.laravel.php
Created March 1, 2020 08:41 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
git remote prune origin
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -d
from __future__ import absolute_import, division, print_function, unicode_literals
import pathlib
import os
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
BATCH_SIZE = 32
@PhamBaTrungThanh
PhamBaTrungThanh / docker-backup.sh
Created September 21, 2019 14:49
Docker backup and restore database
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@PhamBaTrungThanh
PhamBaTrungThanh / cloudSettings
Last active May 8, 2020 02:56
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-08T02:56:10.457Z","extensionVersion":"v3.4.3"}
@PhamBaTrungThanh
PhamBaTrungThanh / cloudflare-update-record.sh
Created April 19, 2019 04:45 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@PhamBaTrungThanh
PhamBaTrungThanh / gist:ad9a80a88d4c81c33f6f03735f9fcb5a
Created December 21, 2018 03:12
multiline text decoration tricks
a {
text-decoration: none;
background-image: linear-gradient(currentColor, currentColor);
background-position: 0% 100%;
background-repeat: no-repeat;
background-size: 0% 2px;
transition: background-size .3s;
}
a:hover {
@PhamBaTrungThanh
PhamBaTrungThanh / index.html
Created February 16, 2018 03:47
A Vietnamese New Year 1st day simple warm up project
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Chúc mừng năm mới 2018</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Pacifico&amp;subset=vietnamese" rel="stylesheet">
<style>
body {