Skip to content

Instantly share code, notes, and snippets.

View sokokaleb's full-sized avatar

Pusaka Kaleb Setyabudi sokokaleb

View GitHub Profile
@sokokaleb
sokokaleb / HashValue.cpp
Last active May 20, 2017 20:36
Class to represent tuple of hash values as a result of remainder from division of an integer with some odd prime numbers.
#include <bits/stdc++.h>
using namespace std;
namespace __hv {
template<typename T>
inline void normalize(T& num, T mod) {
if (num < 0) {
num += mod;
@sokokaleb
sokokaleb / spotify_playback_commands.txt
Created April 17, 2017 17:22
Commands to control Spotify playback (can be used along with keyboard key combination, etc.). Tested on Ubuntu 16.04.
Prerequisite: sudo apt install mpdris2
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
ssl_certificate /etc/letsencrypt/live/[domain]/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/[domain]/privkey.pem;
# Plugins
# =======
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Session management
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Config
set -g @resurrect-processes 'ssh mosh' # Restore ssh and mosh processes
@sokokaleb
sokokaleb / cpp.snippets
Last active May 21, 2017 03:35
Personal C++ snippet for Competitive Programming
snippet prep
#include <bits/stdc++.h>
#define __INIT_CC__ ios::sync_with_stdio(false); \
cin.tie(0);
#ifdef __WIN32__
char getchar_unlocked() {return getchar();}
#endif
@sokokaleb
sokokaleb / .bash_profile
Created February 4, 2017 17:41
Personal .bash_profile for OS X
# ~/.bash_profile
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagaced
alias ls='ls -G'
alias ll='ls -alF'
alias g++='g++-6 -std=c++98'
alias g++x='g++-6 -std=c++11'
alias g++y='g++-6'
@sokokaleb
sokokaleb / .vimrc
Last active December 16, 2022 23:37
Personal .vim config file
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required