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 / .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
Loading
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 / sublime-text-scopes.md
Created September 25, 2019 07:45 — forked from J2TEAM/sublime-text-scopes.md
Sublime Text 2/3: Snippet scopes

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
@vietvudanh
vietvudanh / describe.groovy
Created September 27, 2019 07:10 — forked from robertdale/describe.groovy
JanusGraph Schema Describe Command
// This can be imported via ./bin/gremlin.sh -i describe.groovy
// A variable 'graph' must be defined with a JanusGraph graph
// Run it as a plugin command ':schema'
// :schema describe
//
import org.janusgraph.graphdb.database.management.MgmtLogType
import org.codehaus.groovy.tools.shell.Groovysh
import org.codehaus.groovy.tools.shell.CommandSupport
@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