Skip to content

Instantly share code, notes, and snippets.

View NamPNQ's full-sized avatar
🤒
Out sick

Nam PHAM NamPNQ

🤒
Out sick
  • Ho Chi Minh
View GitHub Profile
@NamPNQ
NamPNQ / flake8
Created January 4, 2016 08:17
config flake8 global
# store in ~/.config/flake8
[flake8]
ignore = F999,E501,E128,E124,E126,F841,E123,F401,F403
max-line-length = 120
exclude = env, .git
@NamPNQ
NamPNQ / README.md
Last active September 20, 2021 21:16
bootmgfw.efi

What are you looking for? The file name bootmgfw.efi to fix window shjt cannot boot? This is here for you :D

@NamPNQ
NamPNQ / README.MD
Last active July 31, 2020 06:05
RUST cross-compiling from Ubuntu to Windows using docker
  1. Go to your project
$ docker run -it --rm `pwd`:/opt/app rust bash
  1. Build
$ apt update && apt install mingw-w64 -y
@NamPNQ
NamPNQ / get_polygons.py
Last active July 3, 2020 02:02
polygons cac quan o viet nam
# -*- coding: utf8 -*-
import json
import requests
import codecs
import locale
import sys
# Wrap sys.stdout into a StreamWriter to allow writing unicode.
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
@NamPNQ
NamPNQ / .gitconfig
Created February 17, 2016 06:33 — forked from ViktorStiskala/.gitconfig
Pycharm as a default git difftool and git mergetool. Add the following to ~/.gitconfig
[diff]
tool = pycharm
[difftool "pycharm"]
cmd = /usr/local/bin/charm diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read
[merge]
tool = pycharm
keepBackup = false
[mergetool "pycharm"]
cmd = /usr/local/bin/charm merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
@NamPNQ
NamPNQ / nginx.conf
Last active July 5, 2019 11:39
Symfony nginx dev config
# Store in /etc/nginx/conf.d/symfony_project.conf
server {
server_name symfony_project.localhost;
root /home/Workspace/symfony_project/web;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app_dev.php$is_args$args;
}
# DEV
@NamPNQ
NamPNQ / index.html
Created January 20, 2014 14:33
Add google comment plugin to your website
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<div id="gplus-cm"></div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#gplus-cm').html('<div class="g-comments" data-width="543" data-href="http://nampnq.vietnamcode.info" data-first_party_property="BLOGGER" data-view_type="FILTERED_POSTMOD">Loading Google+ Comments ...</div>');
});
</script>
<script async type="text/javascript" src="http://apis.google.com/js/plusone.js?callback=gpcb"></script>
@NamPNQ
NamPNQ / default
Last active January 16, 2019 16:26
Nginx lavarel conf
server {
listen 80 default_server;
root /var/www/html/;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
@NamPNQ
NamPNQ / bitcoin-cpuminer.sh
Last active August 22, 2018 03:11 — forked from return1/bitcoin-cpuminer.sh
install a bitcoin cpuminer on ubuntu/debian
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm git gcc -y
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
@NamPNQ
NamPNQ / merge-subtitles.py
Last active August 16, 2018 12:47
Python Merge two subtitles
#!/usr/bin/python3
# -*- coding: utf8 -*-
# ----------------------------------------------------------------------------
# Name: merge-subtitles
# Desc: Merge two subtitles
# Usage: merge-subtitles sub1_file sub2_file out.ass
# Example: merge_subtitles friends_s01e01_720p_bluray_x264-sujaidr.mp4en.srt friends_s01e01_720p_bluray_x264-sujaidr.mp4vi.srt friends_s01e01_720p_bluray_x264-sujaidr.mp4.ass
# Copy From: https://github.com/duyamin/standalone-scripts/blob/master/python/merge-subtitles.py
# ----------------------------------------------------------------------------