Skip to content

Instantly share code, notes, and snippets.

View vietvudanh's full-sized avatar

Viet Vu vietvudanh

  • Ha Noi, Vietnam
View GitHub Profile
# fucntion
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# add to PS1
export PS1="[\u@\h:\W]\$(parse_git_branch)\$ "
# Output
[vietvu@mac15:blog-new] (dev-new)$
@vietvudanh
vietvudanh / scopes.txt
Created June 20, 2017 02:30 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@vietvudanh
vietvudanh / readme.md
Created June 24, 2017 16:12 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@vietvudanh
vietvudanh / EmailBackend.py
Created August 2, 2017 04:34 — forked from brianlittmann/EmailBackend.py
Remove Python's smtplib CRAM-MD5 authentication method if getting SMTPAuthenticationError: (535, 'Authentication failed') and you know credentials are correct.
# settings.py
EMAIL_BACKEND = 'backends.SMTPEmailBackend'
# backends.py
"""Custom SMTP email backend class"""
import smtplib
from django.core.mail.utils import DNS_NAME
from django.core.mail.backends.smtp import EmailBackend
class SMTPEmailBackend(EmailBackend):
@vietvudanh
vietvudanh / .screenrc
Created August 30, 2017 06:27 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@vietvudanh
vietvudanh / chiasenhac.py
Last active October 17, 2020 13:37
download album from chiasenhac
"""script for downloading album from chiasenhac
"""
import time
import sys
from pathlib import Path
from bs4 import BeautifulSoup
import requests
from multiprocessing import Pool
BASE_OUTPUT = 'albums'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vietvudanh
vietvudanh / explode.py
Created March 26, 2019 04:58
explode list-type cell in pandas
# credited to: https://stackoverflow.com/a/40449726
'''
df
var1 var2 var3
0 [a, b, c] 1 XX
1 [d, e, f, x, y] 2 ZZ
'''
lst_col = 'var1'
@vietvudanh
vietvudanh / manage.sh
Last active August 24, 2019 01:57
manage script in bash
#!/usr/bin/env bash
# template for maange script in bash
# provide listing functions / usage.. etc
CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# START vars
LOG_FILE="$CWD/log.log"
# END vars
@vietvudanh
vietvudanh / tmux.conf
Created September 24, 2019 01:33
tmux config
# vim ~/.tmux.conf
# command prefix
unbind C-b
set-option -g prefix C-a