Skip to content

Instantly share code, notes, and snippets.

View EsanLe's full-sized avatar

EsanLe EsanLe

View GitHub Profile
@EsanLe
EsanLe / example.puml
Created September 3, 2018 03:07 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram. The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@EsanLe
EsanLe / install.sh
Created August 2, 2018 03:38 — forked from chuyik/install.sh
Bandwagon(搬瓦工) CentOS 7 安装 shadowsocks-libev 和 kcptun
######################
## shadowsocks-libev
######################
# install dependencies
yum install epel-release -y
yum install gcc gettext autoconf libtool automake make pcre-devel asciidoc xmlto udns-devel libev-devel -y
# install shadowsocks-libev
cd /etc/yum.repos.d/
@EsanLe
EsanLe / jsonp.js
Created July 27, 2017 06:18
jsonp.js
/**
* @file jsonp请求
*/
// 获取jsonp
const jsonp = (options) => {
if(!options || !options.url) return;
// const container = document.getElementsByTagName('body')[0];
const container = document.body;
@EsanLe
EsanLe / gist:bc75e2c7aa20ab773ea835b748185ac1
Created October 10, 2016 05:33
简单的最小堆实现
/**
* Heap 简单的最小堆实现
*
* @returns {undefined}
*/
var Heap = function() {
this.data = [];
};
Heap.prototype = {
@EsanLe
EsanLe / gist:00eadc26cc7cf8adaa52a55b0d92533a
Created July 17, 2016 05:47
Fix genymontion 2.7.2 crash in AUR
#!/bin/sh
# Extract pango package
cd /tmp
rm -rf pango-1.36.8-1-x86_64.pkg.tar.xz
wget https://archive.archlinux.org/packages/p/pango/pango-1.36.8-1-x86_64.pkg.tar.xz
mkdir pango
tar -xJf pango-1.36.8-1-x86_64.pkg.tar.xz -C ./pango
# Copy pango lib
@EsanLe
EsanLe / nodejs
Created April 11, 2016 04:54
node.js init.d script for CentOS
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="nodejs"
# Recursively add a .gitignore file to all directories
# in the working directory which are empty and don't
# start with a dot. Helpful for tracking empty dirs
# in a git repository.
for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done;