Skip to content

Instantly share code, notes, and snippets.

View Shuailong's full-sized avatar
🎯
Focusing

Lucas Liang Shuailong

🎯
Focusing
View GitHub Profile
@Shuailong
Shuailong / vim_commands.txt
Created April 25, 2020 03:27
Frequently used vim commands
# tab management
vim -p file1 file2 ... open multiple files each in a tab:
:tabedit {file} edit specified file in a new tab
:tabfind {file} open a new tab with filename given, searching the 'path' to find it
:tabclose close current tab
:tabclose {i} close i-th tab
:tabonly close all other tabs (show only the current tab)
@Shuailong
Shuailong / rbenv_commands.sh
Last active April 10, 2020 03:21
rbenv commands
# Install rbenv
brew install rbenv
# Completely uninstall rbenv
brew uninstall rbenv
# list all available versions
rbenv install -l
# install a specific Ruby version
@Shuailong
Shuailong / install-tmux.sh
Last active April 9, 2020 07:57
Install tmux and common comands
# Linux
sudo apt install tmux
# Mac
brew install tmux
# install oh my tmux
cd
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
@Shuailong
Shuailong / figlet.py
Created May 6, 2019 04:06
ASCII Art Font
from pyfiglet import Figlet
f = Figlet(font='slant')
print(f.renderText('Welcome!'))
# _ __ __ __
#| | / /__ / /________ ____ ___ ___ / /
#| | /| / / _ \/ / ___/ __ \/ __ `__ \/ _ \/ /
#| |/ |/ / __/ / /__/ /_/ / / / / / / __/_/
#|__/|__/\___/_/\___/\____/_/ /_/ /_/\___(_)
@Shuailong
Shuailong / main.py
Created October 13, 2018 16:44
RL GridWorld Demo
import numpy as np
from time import sleep
from sailing import SailingGridworld
import random
gamma = 0.9
# Set up the environment
env = SailingGridworld(rock_penalty=-2)
@Shuailong
Shuailong / progress bar.py
Created May 15, 2018 13:50
keras style progress bar
#!/usr/bin/env python
# encoding: utf-8
"""
progressbar.py
Created by Shuailong on 2017-05-20.
Progress bar and logger.
@Shuailong
Shuailong / calc_emb_statistics.py
Created April 30, 2018 05:18
Calculate Pretrained Embedding mean and std
# coding: utf-8
'''
Calculate the mean and variance of each dimension of glove or w2v.
'''
import argparse
from tqdm import tqdm
import torch
parser = argparse.ArgumentParser(