Skip to content

Instantly share code, notes, and snippets.

View luyaor's full-sized avatar

Luyao Ren luyaor

View GitHub Profile
@luyaor
luyaor / useful_linux_command.sh
Created November 9, 2018 08:59
Useful Linux command
# 查看磁盘情况
df -h
# 查看当前目录中文件夹大小
du -ah --max-depth=1
# 杀死名称中带有$name的进程
ps aux | grep $name | awk '{print $2}' | xargs kill -9
# 文件名批量替换,-n可以删前检查
@luyaor
luyaor / how_to_deploy_flask_app.md
Last active November 9, 2018 11:48
A Simple Tutorial for deploying your Flask application with uWSGI + nginx on server without root permission

replace $your_home_path as your home path like /home/renluyao

it will create two folders under $your_home_path: /test and /nginx.

install flask using pip

pip install flask
@luyaor
luyaor / git_command_cheatsheet.bash
Last active November 9, 2018 11:46
git command cheatsheet
----------- merge rly to master ------
git stash
git checkout master
git pull
git checkout rly
git diff
git merge master
git add -A
git commit -m “some words”
git push origin rly
@luyaor
luyaor / .vimrc
Created January 26, 2018 14:21
config for vim
filetype indent on
filetype plugin indent on
set completeopt=longest,menu
set nu
syntax enable
syntax on
color koehler
set nowrap
set guioptions+=b
set autoindent
@luyaor
luyaor / ExampleOnDoubanMovies.py
Created January 26, 2018 14:21
Crawler On Douban Movies using python
#-*-coding:utf-8-*-
from selenium import webdriver
import re
import csv
# Support for Chinese
import sys
import codecs
reload(sys)
sys.setdefaultencoding('utf-8')
@luyaor
luyaor / cuda_matrix_mul.c
Created January 26, 2018 14:20
Two ways of implement matrix mul in cuda
// by block
#include "stdio.h"
#include "stdlib.h"
#include "cuda.h"
#include "cuda_runtime.h"
#define W 16
#define NN 1024
int matrixMul_cpu(float *M, float *N, float *P)
@luyaor
luyaor / SegmentTree.cc
Created January 26, 2018 14:18
SegmentTree(OO version)
#include <bits/stdc++.h>
/* -------------------------------------------------------------------------- */
// The interval in segment tree.
// The interval [L, R] contains the points whose index is between L and R.
struct Interval {
int left_index, right_index;
};