Skip to content

Instantly share code, notes, and snippets.

View lxj5891's full-sized avatar

DAC-HaoLi lxj5891

  • 敏捷不是一种方法,而是态度。
View GitHub Profile
@lxj5891
lxj5891 / Angular.md
Last active August 29, 2015 14:10
Angular.js

AngularJS开发指南01:AngularJS简介

什么是 AngularJS?

AngularJS󰀃是一个为动态WEB应用设计的结构框架。它能让你使用HTML作为模板语言,通过扩展HTML的语法,让你能更清楚、简洁地构建你的应用组件。它的创新点在于,利用数据绑定依赖注入,它使你不用再写大量的代码了。这些全都是通过浏览器端的Javascript实现,这也使得它能够完美地和任何服务器端技术结合。 AngularJS是为了克服HTML在构建应用上的不足而设计的。HTML是一门很好的为静态文本展示设计的声明式语言,但要构建WEB应用的话它就显得乏力了。所以我做了一些工作(你也可以觉得是小花招)来让浏览器做我想要的事。 通常,我们是通过以下技术来解决静态网页技术在构建动态应用上的不足:

类库 类库是一些函数的集合,它能帮助你写WEB应用。起主导作用的是你的代码,由你来决定何时使用类库。类库有:jQuery等

框架 框架是一种特殊的、已经实现了的WEB应用,你只需要对它填充具体的业务逻辑。这里框架是起主导作用的,由它来根据具体的应用逻辑来调用你的代码。框架有:knockout、sproutcore等。

AngularJS使用了不同的方法,它尝试去补足HTML本身在构建应用方面的缺陷。

fjdslfjkdlsfj

======== helloworld

Mongo触发器

=========================

环境搭建

  • db:10.2.9.104    root/ssmartdb
  • db:10.2.9.105    root/ssmartdb
  • db:10.2.9.106    root/ssmartdb
  • db:10.2.9.107    root/ssmartdb
"use strict";
var async = require('async');
var events = require('events');
var stream = require('stream');
var util = require('util');
var MongoClient = require('mongodb').MongoClient;
var direct_port = 22001;
var mongos_port = 20000;
@lxj5891
lxj5891 / mongodb.sh
Created July 14, 2014 04:36
mongodb 环境
mkdir -p /data/test/config/db/
mkdir -p /data/test/config/log/
mkdir -p /data/test/mongos/log/
mkdir -p /data/test/shard1/db/
mkdir -p /data/test/shard1/log/
mkdir -p /data/test/shard2/db/
mkdir -p /data/test/shard2/log/
mongod --configsvr --dbpath /data/test/config/db --port 21000 --logpath /data/test/config/log/config.log --fork
@lxj5891
lxj5891 / test.md
Last active August 29, 2015 14:03
test环境测试

Mongo 触发器 环境测试

==========================

环境测试

  • 环境

db1:10.2.9.104

db2:10.2.9.105

// MongoDB Extention
// * Embeddeds Pattern
// * Ancestors Pattern
var metadata = 'metadata';
var metadata_embeddeds = 'embeddeds'; // metadata.embeddeds
var metadata_ancestors = 'ancestors'; // metadata.ancestors
var stop_collection = 'test.stop'; // database:test collection:stop
@lxj5891
lxj5891 / trigger
Created July 10, 2014 02:08
trigger
// MongoDB Extention
// * Embeddeds Pattern
// * Ancestors Pattern
var metadata = 'metadata';
var metadata_embeddeds = 'embeddeds'; // metadata.embeddeds
var metadata_ancestors = 'ancestors'; // metadata.ancestors
var stop_collection = 'test.stop'; // database:test collection:stop
@lxj5891
lxj5891 / ffmpeg 编程.c
Created April 17, 2014 01:30
ffmpeg 编程
av_register_all();
if(av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0)
printf("error!\n");
if(av_find_stream_info(pFormatCtx)<0)
printf("error!\n");
videoStream=-1;
@lxj5891
lxj5891 / VOIP手顺
Created April 15, 2014 00:57
VOIP 技术
yum install libncurses5-dev
yum install http://yum.opensips.org/1.10/releases/el/6/x86_64/opensips-yum-releases-1.10-1.el6.noarch.rpm
opensipsdbctl restart
git clone git://sippy.git.sourceforge.net/gitroot/sippy/rtpproxy
./configure