Skip to content

Instantly share code, notes, and snippets.

View LplusKira's full-sized avatar
🐙
focusing on Microsoft/pai

Po-Kai Chang LplusKira

🐙
focusing on Microsoft/pai
View GitHub Profile
#include <vector>
#include <unordered_map>
#include <map>
#include <cassert>
#include <iostream>
using namespace std;
class Solver {
public:
#include <vector>
#include <cassert>
using namespace std;
class Solver {
public:
Solver() = default;
int solve(vector<int>& pkgs) {
if (pkgs.empty()) return 0;
@LplusKira
LplusKira / installTmuxUbuntu.sh
Last active October 27, 2020 00:44
tmux 3.0a installation script on ubuntu:16.04
#!/bin/bash
set -e
VERSION="3.0a"
wait_time=10
my_cfg="https://gist.githubusercontent.com/LplusKira/e6c44f54b79b04b5dba9198fec5a9acd/raw/f1fab270c7abcb91f19e07d3775639f5763f23d1/.tmux.conf"
echo "Enter your password: "
read -s password
echo "This will remove current tmux and replace it with ver: ${VERSION}"
@LplusKira
LplusKira / installNodeByVer.sh
Last active May 31, 2020 06:49
On (at least) ubuntu 16.04
#!/bin/bash
## - Ref: https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/
# Configuring ...
printf "Type current usr's password: "
read -s password
echo ""
printf "Type major version (e.g. 12): "
read ver
echo ""
@LplusKira
LplusKira / setDefaultGitCfg.sh
Created April 1, 2019 08:57
Set default git config
#!/bin/bash
git config --global user.name "LplusKira"
git config --global user.email pokaichangtwn@gmail.com
git config --global core.editor vim
@LplusKira
LplusKira / installMyVim.sh
Last active October 26, 2020 21:11
For ubuntu 16.04
#!/bin/bash
# - (Ubuntu 16.04 and later only)
set -e
# Checking dependencies ...
## - Assert prerequisites git, curl, python3, my .vimrc
apt-get update -y
apt-get install -y git python3 curl cmake
#git --version
#python3 --version
@LplusKira
LplusKira / addLocalSudoer.sh
Created March 4, 2019 09:35
For ubuntu 16.04 add sudoer in current ssh login session
#!/bin/bash
## - Ref: https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart
echo "ONLY use this script on ubuntu 16.04 -- \"lay down butcher's knife, become a Buddha on the spot\""
# Adding ...
printf "Type to-be-created usr name: "
read username
echo ""
sudo adduser ${username}
@LplusKira
LplusKira / .tmux.conf
Last active October 27, 2020 00:44
For ubuntu 16.04
###
# Tmux config for 3.0a
###
# set the prefix of tmux from ctl-b to ctl-a
set-option -g prefix C-a
# use bash as tmux' default shell
@LplusKira
LplusKira / .tmux.conf
Last active September 14, 2020 04:38
For MBP
###
# Tmux config for 3.0a
###
# set the prefix of tmux from ctl-a to ctl-b
set-option -g prefix C-a
# use zsh as tmux' default shell
@LplusKira
LplusKira / .vimrc
Last active December 19, 2022 21:07
.vimrc
scriptencoding utf-8
"
" ██╗ ██╗ ██╗ ███╗ ███╗ ██████╗ ██████╗
" ██║ ██║ ██║ ████╗ ████║ ██╔══██╗ ██╔════╝
" ██║ ██║ ██║ ██╔████╔██║ ██████╔╝ ██║
" ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║ ██╔══██╗ ██║
" ██╗╚████╔╝ ██║ ██║ ╚═╝ ██║ ██║ ██║ ╚██████╗
" ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝
"