-
Notifications
You must be signed in to change notification settings - Fork 0
/
mydbbkup.json
8 lines (8 loc) · 13.1 KB
/
mydbbkup.json
1
2
3
4
5
6
7
8
{ "date" : 1341978409431, "title" : "t1", "text" : "This is a test", "_id" : { "$oid" : "4ffcf73774370c0200000001" } }
{ "date" : 1341978427971, "title" : "T2", "text" : "this is an other test", "_id" : { "$oid" : "4ffcf74a74370c0200000002" } }
{ "_id" : { "$oid" : "4ffcf8a174370c0200000003" }, "date" : 1341978769888, "title" : "Markup Helper", "text" : "# Mou\n\n![Mou icon](http://mouapp.com/Mou_128.png)\n\n## Overview\n\n**Mou**, the missing Markdown editor for *web developers*.\n\n### Syntax\n\n#### Strong and Emphasize \n\n**strong** or __strong__ ( Cmd + B )\n\n*emphasize* or _emphasize_ ( Cmd + I )\n\n**Sometimes I want a lot of text to be bold.\nLike, seriously, a _LOT_ of text**\n\n#### Blockquotes\n\n> Right angle brackets > are used for block quotes.\n\n#### Links and Email\n\nAn email <example@example.com> link.\n\nSimple inline link <http://chenluois.com>, another inline link [Smaller](http://smallerapp.com), one more inline link with title [Resize](http://resizesafari.com \"a Safari extension\").\n\nA [reference style][id] link. Input id, then anywhere in the doc, define the link with corresponding id:\n\n[id]: http://mouapp.com \"Markdown editor on Mac OS X\"\n\nTitles ( or called tool tips ) in the links are optional.\n\n#### Images\n\nAn inline image ![Smaller icon](http://smallerapp.com/favicon.ico \"Title here\"), title is optional.\n\nA ![Resize icon][2] reference style image.\n\n[2]: http://resizesafari.com/favicon.ico \"Title\"\n\n#### Inline code and Block code\n\nInline code are surround by `backtick` key. To create a block code:\n\n\tIndent each line by at least 1 tab, or 4 spaces.\n var Mou = exactlyTheAppIwant; \n\n#### Ordered Lists\n\nOrdered lists are created using \"1.\" + Space:\n\n1. Ordered list item\n2. Ordered list item\n3. Ordered list item\n\n#### Unordered Lists\n\nUnordered list are created using \"*\" + Space:\n\n* Unordered list item\n* Unordered list item\n* Unordered list item \n\nOr using \"-\" + Space:\n\n- Unordered list item\n- Unordered list item\n- Unordered list item\n\n#### Hard Linebreak\n\nEnd a line with two or more spaces will create a hard linebreak, called `<br />` in HTML. ( Control + Return ) \nAbove line ended with 2 spaces.\n\n#### Horizontal Rules\n\nThree or more asterisks or dashes:\n\n***\n\n---\n\n- - - -\n\n#### Headers\n\nSetext-style:\n\nThis is H1\n==========\n\nThis is H2\n----------\n\natx-style:\n\n# This is H1\n## This is H2\n### This is H3\n#### This is H4\n##### This is H5\n###### This is H6\n\n\n### Extra Syntax\n\n#### Strikethrough\n\nWrap with 2 tilde characters:\n\n~~Strikethrough~~\n\n\n#### Fenced Code Blocks\n\nStart with a line containing 3 or more backticks, and ends with the first line with the same number of backticks:\n\n```\nFenced code blocks are like Stardard Markdown’s regular code\nblocks, except that they’re not indented and instead rely on\na start and end fence lines to delimit the code block.\n```" }
{ "_id" : { "$oid" : "4ffcfe7076936e0200000001" }, "title" : "HEllo WORLD", "text" : "#This is a H1\n\n##This is a H2\n\nthis some para...\n\n```\n\n// this is a comment\n\nonSave: function(post){\n if(post._id == undefined){\n\n PostRes.save(post, function(post) {\n $location.path('post/' + post._id + '/edit');\n });\n }else{\n post.update(function(post) {\n $location.path('post/');\n });\n }\n }\n```\n\n#hello\n\n>“People ask me to predict the future, when all I want to do is prevent it. Better yet, build it. Predicting the future is much too easy, anyway. You look at the people around you, the street you stand on, the visible air you breathe, and predict more of the same. To hell with more. I want better.”\n\n>__RAY BRADBURY, 1920–2012__" }
{ "_id" : { "$oid" : "500fd41ca9a55f0200000001" }, "date" : 1343214607216, "title" : "test", "text" : "a;sldka sdf\nasgsgfafdg\n\n\n```\n var test = \"ergererg\";\n```" }
{ "date" : 1354756391438, "title" : "Post Title", "text" : "Basically the EventBus pattern is just in a Singleton Object you share across your app, that lets you publish and subscribe to events. It enables you to share states, events, data etc.. across Objects that have no reference to each other. It's an elegant and decoupled way to communicates in-between Objects.\n\n>\"This pattern let's you orchestrate the states of your app in a simple and decoupled way.\"\n\n#A War Game\nLet's say that we are building a war game, at some point in the game all the units ( tanks, planes, ships, soldiers etc... ) needs to be alerted if an important event happens ( like: \"The base is under attack !\" kind of event ) .\nWith the EventBus pattern, all units share a reference to the EventBus enabling them to \"listent\" or \"subscribe\", to the **\"BASE UNDER ATTACK\"** event that initiates a \"QuickReturnToBase\" commande. Not only all units are alerted instantaneously, but every units can also \"send\" or \"publish\" a **\"BASE UNDER ATTACK\"** event, witch would be very handy in a war game.\n\n###The War Unit \n```\n(function($,W,D,EventBus){\n\n W.WAR_UNITS.Tanks = {\n\n init: function(){\n EventBus.subscribe('BASE_UNDER_ATTACK', this.quickReturnToBase);\n },\n\n alertUnitsBaseUnderAttack: function(){\n EventBus.dispatch('BASE_UNDER_ATTACK');\n },\n\n quickReturnToBase: function(){},\n seachAndDestroy: function(){}\n\n }\n})(jQuery, window, document, EventBus)\n```\n\nThat's it with this simple pattern in mind you can wire you application in a decoupled way that will enable a flexible architecture. Lots of frameworks implements the EventBus pattern out of the box. Angularjs provides the $broadcast dependency to wire your application. You request the $broadcast dependency, and then you broadcast events on a scope, preferably the $rootScope if you want all the Objects to be notified, and then you just listen through the $scope.$on('eventName') commande.\n\n###AngularJS EventBus\n```\nfunction onSave(post) {\n $http.put('/api/post/' + post._id, angular.extend({}, post, {_id:undefined})).\n success(function (data) {\n $log.info('Save Success');\n PostSrv.originalPost = data;\n }).\n error(function (data, status, headers, config) {\n $log.info('Save Error');\n $rootScope.$broadcast('error',{status:status, data:data, headers:headers});\n });\n}\n\nfunction MainCtrl($scope, $log, $location, $rootScope) {\n $scope.$on('error', function(event, obj){\n if(obj.status === 401){\n $location.path('login');\n }\n });\n}\nMainCtrl.$inject = ['$scope', '$log', '$location', '$rootScope'];\n```\n\nIn this example I am publishing an \"error\" event on the $rootScope, that I then capture in the MainCtrl to redirect the user to the login page.\nNo matter wich Object send the \"error\" event through with the EventBus Pattern I have one place to responde to it.", "_id" : { "$oid" : "50bff16c3a99c40200000004" } }
{ "date" : 1354756391438, "title" : "Post Title", "text" : "Basically the EventBus pattern is just in a Singleton Object you share across your app, that lets you publish and subscribe to events. It enables you to share states, events, data etc.. across Objects that have no reference to each other. It's an elegant and decoupled way to communicates in-between Objects.\n\n>\"This pattern let's you orchestrate the states of your app in a simple and decoupled way.\"\n\n#A War Game\nLet's say that we are building a war game, at some point in the game all the units ( tanks, planes, ships, soldiers etc... ) needs to be alerted if an important event happens ( like: \"The base is under attack !\" kind of event ) .\nWith the EventBus pattern, all units share a reference to the EventBus enabling them to \"listent\" or \"subscribe\", to the **\"BASE UNDER ATTACK\"** event that initiates a \"QuickReturnToBase\" commande. Not only all units are alerted instantaneously, but every units can also \"send\" or \"publish\" a **\"BASE UNDER ATTACK\"** event, witch would be very handy in a war game.\n\n###The War Unit \n```\n(function($,W,D,EventBus){\n\n W.WAR_UNITS.Tanks = {\n\n init: function(){\n EventBus.subscribe('BASE_UNDER_ATTACK', this.quickReturnToBase);\n },\n\n alertUnitsBaseUnderAttack: function(){\n EventBus.dispatch('BASE_UNDER_ATTACK');\n },\n\n quickReturnToBase: function(){},\n seachAndDestroy: function(){}\n\n }\n})(jQuery, window, document, EventBus)\n```\n\nThat's it with this simple pattern in mind you can wire you application in a decoupled way that will enable a flexible architecture. Lots of frameworks implements the EventBus pattern out of the box. Angularjs provides the $broadcast dependency to wire your application. You request the $broadcast dependency, and then you broadcast events on a scope, preferably the $rootScope if you want all the Objects to be notified, and then you just listen through the $scope.$on('eventName') commande.\n\n###AngularJS EventBus\n```\nfunction onSave(post) {\n $http.put('/api/post/' + post._id, angular.extend({}, post, {_id:undefined})).\n success(function (data) {\n $log.info('Save Success');\n PostSrv.originalPost = data;\n }).\n error(function (data, status, headers, config) {\n $log.info('Save Error');\n $rootScope.$broadcast('error',{status:status, data:data, headers:headers});\n });\n}\n\nfunction MainCtrl($scope, $log, $location, $rootScope) {\n $scope.$on('error', function(event, obj){\n if(obj.status === 401){\n $location.path('login');\n }\n });\n}\nMainCtrl.$inject = ['$scope', '$log', '$location', '$rootScope'];\n```\n\nIn this example I am publishing an \"error\" event on the $rootScope, that I then capture in the MainCtrl to redirect the user to the login page.\nNo matter wich Object send the \"error\" event through with the EventBus Pattern I have one place to responde to it.", "_id" : { "$oid" : "50bff16e3a99c40200000005" } }
{ "date" : 1354756391438, "title" : "The EventBus Pattern in AngularJS", "text" : "Basically the EventBus pattern is just in a Singleton Object you share across your app, that lets you publish and subscribe to events. It enables you to share states, events, data etc.. across Objects that have no reference to each other. It's an elegant and decoupled way to communicates in-between Objects.\n\n>\"This pattern let's you orchestrate the states of your app in a simple and decoupled way.\"\n\n#A War Game\nLet's say that we are building a war game, at some point in the game all the units ( tanks, planes, ships, soldiers etc... ) needs to be alerted if an important event happens ( like: \"The base is under attack !\" kind of event ) .\nWith the EventBus pattern, all units share a reference to the EventBus enabling them to \"listent\" or \"subscribe\", to the **\"BASE UNDER ATTACK\"** event that initiates a \"QuickReturnToBase\" commande. Not only all units are alerted instantaneously, but every units can also \"send\" or \"publish\" a **\"BASE UNDER ATTACK\"** event, witch would be very handy in a war game.\n\n###The War Unit \n```\n(function($,W,D,EventBus){\n\n W.WAR_UNITS.Tanks = {\n\n init: function(){\n EventBus.subscribe('BASE_UNDER_ATTACK', this.quickReturnToBase);\n },\n\n alertUnitsBaseUnderAttack: function(){\n EventBus.dispatch('BASE_UNDER_ATTACK');\n },\n\n quickReturnToBase: function(){},\n seachAndDestroy: function(){}\n\n }\n})(jQuery, window, document, EventBus)\n```\n\nThat's it with this simple pattern in mind you can wire you application in a decoupled way that will enable a flexible architecture. Lots of frameworks implements the EventBus pattern out of the box. Angularjs provides the $broadcast dependency to wire your application. You request the $broadcast dependency, and then you broadcast events on a scope, preferably the $rootScope if you want all the Objects to be notified, and then you just listen through the $scope.$on('eventName') commande.\n\n###AngularJS EventBus\n```\nfunction onSave(post) {\n $http.put('/api/post/' + post._id, angular.extend({}, post, {_id:undefined})).\n success(function (data) {\n $log.info('Save Success');\n PostSrv.originalPost = data;\n }).\n error(function (data, status, headers, config) {\n $log.info('Save Error');\n $rootScope.$broadcast('error',{status:status, data:data, headers:headers});\n });\n}\n\nfunction MainCtrl($scope, $log, $location, $rootScope) {\n $scope.$on('error', function(event, obj){\n if(obj.status === 401){\n $location.path('login');\n }\n });\n}\nMainCtrl.$inject = ['$scope', '$log', '$location', '$rootScope'];\n```\n\nIn this example I am publishing an \"error\" event on the $rootScope, that I then capture in the MainCtrl to redirect the user to the login page.\nNo matter wich Object send the \"error\" event through with the EventBus Pattern I have one place to responde to it.", "_id" : { "$oid" : "50bff1a13a99c40200000006" } }