Skip to content

Instantly share code, notes, and snippets.

@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

if has("gui_running")
au ColorScheme * hi EndOfBuffer guifg=#002b36
else
au ColorScheme * hi EndOfBuffer ctermfg=bg
endif
@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());
}
@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 / 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 / README.md
Created July 8, 2016 11:56 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@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:

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 / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname