This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('itemServices', ['ngResource']) | |
| .factory('Item', ['$resource', | |
| function ($resource) { | |
| return $resource('items/:id', | |
| {id: '@id'}, | |
| { | |
| query: { | |
| isArray: true, | |
| method: 'GET', | |
| params: {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * The code below shows example usage of the SecureHash class for | |
| * encrypting a password. In terms of additional usage, you should | |
| * store the resulting encrypted password in addition to the salt | |
| * in your db. | |
| */ | |
| // load the class | |
| $secure = new SecureHash(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Universal mongodb reduce function for complex objects | |
| // | |
| // Example: | |
| // | |
| // emit({ total_views: 3, page_type: {home: 1, product: 2}, site_id: [1] }) | |
| // emit({total_views: 5, page_type: {home: 1, collection: 4}, site_id: [2]}) | |
| // | |
| // -> reduce | |
| // | |
| // { total_views: 8, page_type: { home: 2, product: 2, collection: 4 }, site_id: [1,2] } |
NewerOlder