Skip to content

Instantly share code, notes, and snippets.

sudo bash -c "cat <<EOT > /etc/logrotate.d/api
/opt/app/*.log {
missingok
notifempty
compress
size 10k
daily
copytruncate
compress
sharedscripts
@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 {
@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 / 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:
@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
public static IObservable<TRet> ContinueAfter<T, TRet>(this IObservable<T> observable, Func<IObservable<TRet>> selector)
{
return observable
.Materialize()
.Where(n => n.Kind == NotificationKind.OnCompleted)
.SelectMany(_ => selector());
}