Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am hoangtranwork on github.
  • I am hoangtg (https://keybase.io/hoangtg) on keybase.
  • I have a public key whose fingerprint is CEAB C10C 74B5 3D67 7F73 11F3 ECC1 3C2D D43B 9EA3

To claim this, I am signing this object:

@hoangtranwork
hoangtranwork / screenshare
Last active July 6, 2016 12:44 — forked from Saicheg/screenshare
Share screenshots on Ubuntu using Dropbox
#!/bin/bash
################
# Description:
# This script will take screenshot of your desktop
# or only active window ( running with -u param ),
# or a rectangle on screen ( running with -s param ),
# copy it to /Dropbox/Screenshots/ with uniq name
# and save path to clipboard
#################
# Requirements:
@hoangtranwork
hoangtranwork / README.md
Created July 8, 2016 11:56 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@hoangtranwork
hoangtranwork / InvocationExample.kt
Created July 13, 2016 04:27
with invocation set, before/after hook seems to not run correctly around `each` invocation
package kotlintest.playground
import io.kotlintest.KTestJUnitRunner
import io.kotlintest.specs.StringSpec
import org.junit.runner.RunWith
/**
* Created by hoang on 7/13/16.
*/
@RunWith(KTestJUnitRunner::class)
@hoangtranwork
hoangtranwork / MySql6DbType.java
Created August 1, 2016 04:10
mysql6 db type to be used with ormlite
import com.j256.ormlite.db.MysqlDatabaseType;
/**
* Created by Hoang on 2016-05-21.
*/
class MySql6DbType extends MysqlDatabaseType {
@Override
protected String getDriverClassName() {
return "com.mysql.cj.jdbc.Driver";
}
@hoangtranwork
hoangtranwork / DbHelper.java
Created August 1, 2016 04:12
create connectionSource with MySQL driver v6
/**
* The data source instance that need to be public so we can close it in on-app-exit hook
*/
private DataSource initDataSource(HikariConfig config) {
return new HikariDataSource(config);
}
private ConnectionSource initConnectionSource(DataSource ds) throws SQLException {
return new DataSourceConnectionSource(ds, new MySql6DbType());
}
if has("gui_running")
au ColorScheme * hi EndOfBuffer guifg=#002b36
else
au ColorScheme * hi EndOfBuffer ctermfg=bg
endif
@hoangtranwork
hoangtranwork / tmux.md
Created July 21, 2017 04:54 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@hoangtranwork
hoangtranwork / change-hostname-no-restart.md
Last active November 28, 2017 09:32
Without restart. Retain across ssh sessions (pernament). This also help avoiding `sudo: unable to resolve host` warning

Steps:

  1. edit /etc/hostname: only 1 line with the new-hostname
new-hostname
  1. edit /etc/hosts: 2 lines
127.0.0.1 localhost new-hostname
127.0.1.1 new-hostname
@hoangtranwork
hoangtranwork / xxf.zsh-theme
Last active December 19, 2018 22:48 — forked from xfanwu/xxf.zsh-theme
Yet another theme for oh-my-zsh
# Copy and self modified from ys.zsh-theme, the one of default themes in master repository
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# http://xiaofan.at
# 2 Jul 2015 - Xiaofan
# Machine name.
function box_name {