Skip to content

Instantly share code, notes, and snippets.


Pahlevi Fikri Auliya fikriauliya

View GitHub Profile
use std::io;
use std::str;
use std::convert::TryFrom;
use std::collections::HashMap;
use std::str::SplitAsciiWhitespace;
pub struct UnsafeScanner<R> { reader: R, buf_str: Vec<u8>, buf_iter: str::SplitAsciiWhitespace<'static>, }
impl<R: io::BufRead> UnsafeScanner<R> {
pub fn new(reader: R) -> Self { Self { reader, buf_str: vec![], buf_iter: "".split_ascii_whitespace(), } }
pub fn trim_newline(s: &mut String) { if s.ends_with('\n') { s.pop(); if s.ends_with('\r') { s.pop(); } } }
View .tmux.conf
set-option -g prefix C-a
setw -g mode-keys vi
set -g default-terminal "screen-256color"
# status bar config
set -g status-left "#h:[#S]"
set -g status-left-length 50
set -g status-right-length 50
fikriauliya /
Created Sep 2, 2016 — forked from andreyvit/
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
View 0_rapbd_cleaner.rb
contents ='raw_rapbd.txt')
EXCEPTIONS = [/^Urusan Pemerintahan :/, /^Organisasi :/, /^Jumlah/, /^$/, /^Surplus\/\(Defisit\)/, /^Pembiayaan Netto/]
contents.each_line do |l|
l = l.strip
unless /^\d\.\d\d/.match(l)
if EXCEPTIONS.none? {|e| e.match(l)}
print(" #{l}")
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
fikriauliya / basic
Last active May 20, 2017
Most used VIM shortcuts (Config:
View basic
leader: ,
- ctrl + w + direction: move to selected window
- ctrl + w + ctrl + w: move to another window
- ctrl + w + =: male all window equals
- ctrl + w + _: maximize current window
- :hide: close current window
- :only: close other windows
- u: undo
- ctrl + r: redo
- G: go to last line
$ sudo docker run ubuntu:14.04 /bin/echo 'Hello world'
# The -t flag assigns a pseudo-tty or terminal inside our new container and the -i flag allows us to make an interactive connection by grabbing the standard in (STDIN) of the container.
$ sudo docker run -t -i ubuntu:14.04 /bin/bash
# A Daemonized Hello world
$ sudo docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep 1; done"
$ sudo docker ps
fikriauliya / gist:8894932
Last active Aug 29, 2015
Most used Laravel command
View gist:8894932
#Start server
php artisan serve
php artisan migrate:make create_users_table
php artisan migrate
php artisan db:seed
fikriauliya / gist:8894249
Last active Aug 29, 2015
Setting up PHP5.4, Laravel on Ubuntu 10.04
View gist:8894249
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5
sudo mv laravel.phar /usr/local/bin/laravel
sudo chmod ug+x /usr/local/bin/laravel
curl -sS | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod o-x /usr/local/bin/laravel