Skip to content

Instantly share code, notes, and snippets.

View chakhsu's full-sized avatar

Chakhsu.Lau chakhsu

View GitHub Profile
"-------------Vundle的配置文件-----------------
set nocompatible " 去除VI一致性,必须
filetype off " 必须
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" 让vundle管理插件版本,必须
Plugin 'VundleVim/Vundle.vim'
{
"env": {
"node": true,
"es6": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParameters": true,
@chakhsu
chakhsu / ajax.js
Created May 7, 2017 05:11
[Ajax] #JavaScript #Ajax
export function get(url) {
return new Promise(function (resolve, reject) {
const xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.send(null);
xhr.addEventListener('readystatechange', function () {
if (xhr.readyState === 4 && xhr.status === 200) {
try {
const data = JSON.parse(xhr.responseText);
resolve(data);
@chakhsu
chakhsu / escaped-chars.js
Created May 7, 2017 01:51
[Escaped Chars] #HTML #JavaScript
"use strict";
const HTML_ESCAPED_CHARS = {
"<" : "&lt;",
">" : "&gt;",
"\"": "&quot;",
"&" : "&amp;",
"'" : "&#39;",
"/" : "&#47;",
"`" : "&#96;",
@chakhsu
chakhsu / doc.md
Last active May 6, 2017 15:12
[PostgreSQL] #PostgreSQL

Install

homebrew

brew install postgresql

or

@chakhsu
chakhsu / doc.md
Created May 4, 2017 13:32
[npm sourse] #npm

临时换源

npm --registry https://registry.npm.taobao.org install express

永久换源

npm config set registry https://registry.npm.taobao.org
@chakhsu
chakhsu / install.md
Last active May 4, 2017 13:27
[Install Node.js in CentOS] #Node.js #CentOS
@chakhsu
chakhsu / reset.css
Last active July 6, 2022 14:46
[markdown reset css] #css
/* Reset
=============================================================================*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
}
/* Body