Skip to content

Instantly share code, notes, and snippets.

@ZhengRui
ZhengRui / LiveReload.sublime-settings
Last active Mar 16, 2020
SublimeText3 Markdown Preview + LiveReload + Pandoc User Settings
View LiveReload.sublime-settings
{
"enabled_plugins": [
"SimpleReloadPlugin",
"SimpleRefresh"
]
}
@ZhengRui
ZhengRui / config
Created May 26, 2016
i3 configuration
View config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@ZhengRui
ZhengRui / .vimrc
Last active Jan 23, 2017
ubuntu14.04 vim and neovim configuration
View .vimrc
" add for vundle
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
@ZhengRui
ZhengRui / pyqt4RectSelectByStroke.py
Last active May 25, 2016
pyqt4 rectangle select by edge/stroke
View pyqt4RectSelectByStroke.py
from PyQt4 import QtGui, QtCore
import sys
class QStrokeRect(QtGui.QGraphicsRectItem):
def __init__(self, parent=None):
super(QStrokeRect, self).__init__(parent)
self.strokeWidth = 4
self.setPen(QtGui.QPen(QtGui.QColor(255, 0, 0), 4, QtCore.Qt.SolidLine))
self.setFlags(QtGui.QGraphicsItem.ItemIsSelectable)
@ZhengRui
ZhengRui / updateMatplotlibPlot.py
Last active Mar 28, 2020
Update Matplotlib Plot
View updateMatplotlibPlot.py
#! /usr/bin/env python
import matplotlib
import matplotlib.pyplot as plt
matplotlib.style.use("ggplot")
import numpy as np
import time
def newfig(l):