Skip to content

Instantly share code, notes, and snippets.

@qknow-w
qknow-w / react-videojs-es6.js
Created August 28, 2016 12:55
react-videojs-es6
import React, {Component} from "react";
import cx from 'classnames';
import vjs from 'video.js';
import _ from 'lodash';
import ReactDOM from 'react-dom';
const DEFAULT_HEIGHT = "100%";
const DEFAULT_WIDTH = "100%";
const DEFAULT_ASPECT_RATIO = (9 / 16);
const DEFAULT_ADJUSTED_SIZE = 0;
@qknow-w
qknow-w / gist:1c5b0e9a76a3203fb849df7cc19e611c
Created October 31, 2016 07:47 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
/**
* 初始化rabbitmq
* author: colin.xu
* 2016.11.8
*/
const amqp = require('amqplib');
const config = require('config');
const log4js = require('log4js');
const logger = log4js.getLogger('amqp');
@qknow-w
qknow-w / encrypt_decrypt_example.js
Created March 1, 2017 12:10 — forked from erans/encrypt_decrypt_example.js
Example of encryption and decryption in node.js
var crypto = require("crypto")
function encrypt(key, data) {
var cipher = crypto.createCipher('aes-256-cbc', key);
var crypted = cipher.update(text, 'utf-8', 'hex');
crypted += cipher.final('hex');
return crypted;
}
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@qknow-w
qknow-w / docker-compose.yml
Last active October 12, 2020 10:20 — forked from jmlrt/docker-compose.yml
MongoDB Replica Set with Docker
version: '2'
services:
mongo1:
container_name: mongo1
image: daocloud.io/mongo
ports:
- 27017:27017
expose:
- 27017
networks:
@qknow-w
qknow-w / API.md
Created December 21, 2017 02:08 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

/**
* 获取url参数值
* @param {string} url 需要获取参数的url
* @param {string} name 需要获取的参数名
* @return {string} 返回获取的参数名
*/
var getUrlParam = function(name, url){
if(!name){
return '';
}
@qknow-w
qknow-w / installing_cassandra.md
Created December 14, 2018 07:55 — forked from hkhamm/installing_cassandra.md
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@qknow-w
qknow-w / .zshrc
Created August 20, 2020 06:46
zsh ignore case
```
autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
```