Skip to content

Instantly share code, notes, and snippets.

View vub's full-sized avatar
🚀
Make it launch!

Bùi Minh Vũ vub

🚀
Make it launch!
View GitHub Profile
@vub
vub / Build v8 engine 2023 - Ubuntu 18.sh
Last active October 12, 2023 13:35
Build v8 engine 2023 - Ubuntu 18
# This file isn't a script
mkdir v8
cd v8
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:$PWD/depot_tools
gclient sync #Can skip if error occur
fetch v8
cd v8
@vub
vub / gist:2bc6c30b5dcf7828dce987f72de27183
Created August 17, 2023 09:36
Python - splitting a module into multiple files
Python Clean Code Tip:
When your module becomes too big you can restructure it to a package while keeping all the imports from the module as they were.
👇
# BEFORE
# models.py
class Order:
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile C:\Users\amdin\.ssh\id_rsa
IdentitiesOnly yes
@vub
vub / clean-docker-instance
Last active January 12, 2021 10:35
Clean Restart of a Docker Instance
Stop the container(s) using the following command:
```
docker-compose down
```
Delete all containers using the following command:
```
docker rm -f $(docker ps -a -q)
```
Delete all volumes using the following command:
```
@vub
vub / Docker-export-import.sh
Created December 23, 2020 03:01
Docker export import images
docker save postgres > postgres.tar
# docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]
docker import postgres.tar postgres:latest
@vub
vub / clean-windows.ps1
Created December 22, 2020 11:36
Script to clean windows
yarn cache clean
npm cache clean --force
npm cache verify
Remove-Item -path C:\Users\Admin\Downloads -recurse
Clear-RecycleBin -Force
<#
Note: Eliminate `-WhatIf` parameter to get action be actually done
Note: PS with version prior to 4.0 can't delete non-empty folders
#>
@vub
vub / progress.sh
Created December 22, 2020 11:19
Progress in windows bash
echo -ne '##### (33%)\r'
sleep 1
echo -ne '############# (66%)\r'
sleep 1
echo -ne '####################### (100%)\r'
echo -ne '\n'
@vub
vub / keycloak_issue.txt
Last active December 21, 2020 04:09
keycloak infinity loop
For those have issue "Infinity loop" while run front-end locally in Chrome or new Egde development. Try to do following steps:
```
Access chrome://flags/ or edge://flags/
_> Searching for : SameSite by default cookies
_> Select Disable
_> Reset browser
```
This is issue relate to New default SameSite configuration of Chrome and not affect in test or production environment ( because these site is same site with auth keycloak server )
@vub
vub / model.js
Last active December 2, 2019 01:56
export default TEST = {
createdAt: '2019/12/11 00.00.000',
updatedAt: '2019/12/11 00.00.000',
publishAt: '2019/12/11 00.00.000',
views: 1000,
taken: 100,
homeworkId: Object('12345'),
name: 'Listening test',
description: 'This test get from ABC IELTS book',
type: 'reading || listening || writing',
@vub
vub / _webserver.md
Created November 24, 2019 05:58 — forked from jgravois/_webserver.md
a simple guide for getting a local web server set up

Do I have a web server running?


having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load your own static files (.html, .js etc.) in a browser via http://.

if you're not sure whether or not you have a web server running, no problem! its easy to confirm.

what happens when you visit http://localhost/?