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
| db.customers.aggregate([ | |
| { | |
| $lookup: { | |
| from: "events", // field in the items collection | |
| as: "events", | |
| let: { cus_id: "$_id"}, | |
| pipeline: [ | |
| { $match: | |
| { $expr: | |
| { $and: |
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
| #!/bin/sh | |
| echo "Flushing iptables rules..." | |
| sleep 1 | |
| iptables -F | |
| iptables -X | |
| iptables -t nat -F | |
| iptables -t nat -X | |
| iptables -t mangle -F | |
| iptables -t mangle -X | |
| iptables -P INPUT ACCEPT |
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
| nano ~/.bash_profile | |
| # insert these | |
| export GOPATH=$HOME/go | |
| export PATH=$PATH:$HOME/go/bin | |
| # Finish and. save file | |
| source ~/.bash_profile |
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
| Start the registry as a service on your swarm: | |
| $ docker service create --name registry --publish published=5000,target=5000 registry:2 | |
| Check its status with docker service ls: | |
| $ docker service ls | |
| ID NAME REPLICAS IMAGE COMMAND | |
| l7791tpuwkco registry 1/1 registry:2@sha256:1152291c7f93a4ea2ddc95e46d142c31e743b6dd70e194af9e6ebe530f782c17 |
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
| #!/bin/bash | |
| # Stop all containers at once | |
| docker kill $(docker ps -q) | |
| # Delete all containers | |
| docker rm $(docker ps -a -q) | |
| # Delete all images | |
| docker rmi $(docker images -q) | |
| docker network prune | |
| docker system prune -a |
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
| var fieldSchema = new Schema({ | |
| sectionId: { type: ObjectId, ref: 'Section',required: false }, | |
| type : { type: String, required: true, trim: true, default: 'table'}, | |
| name : { type: String, required: true, trim: true, uniq: true}, | |
| label : { type: String, required: true, trim: true}, | |
| format : { type: 'String'}, | |
| decimal : { type: 'Number'}, | |
| list : [{ name : { type: String }}], | |
| formula : { type: 'Mixed'}//optional is the field is calculated |
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
| var customFields = db.customfields.find({}).toArray(); | |
| var groupIds = []; | |
| customFields = customFields.map(customField => { | |
| customField.collections = customField.collections.map(item => { | |
| item.fieldGroups = item.fieldGroups.filter(groupItem => /Desktop Comments/i.test(groupItem.name) || /Surveillance Comments/i.test(groupItem.name)); | |
| item.fieldGroups.forEach(group => groupIds.push(group._id)); | |
| return item; | |
| }); | |
| return customField; | |
| }); |
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
| var myScope = angular.element($('cfe-profile-header')).scope().$parent; | |
| myScope.isProfilePrivate = false; | |
| myScope.settings.enableServiceProfiles = true; |
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
| /^[0-9a-fA-F]{24}$ |
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
| <div style="padding: 0px" class="row expanded-portfolio-container"> | |
| <reorderable-container-component storage-key="vm.reorderableStorageKey" | |
| on-reorder="vm.onReorderCallback(data)" | |
| reorderable-components="vm.portfolioComponents" | |
| class="portfolio-container reorderable-component-container border-top row"> | |
| <div style="background-color: #3E3E3E;" ng-if="component.type !== 'custom-group'" static-include="'templates/investments/portfolio/expanded-portfolio/{{component.file}}'"></div> | |
| <div ng-if="component.type === 'custom-group'"> | |
| <custom-value-list collection-name="component.data.collectionName" collection-id="component.data.collectionId" group_id="component.data.groupId"></custom-value-list> | |
| </div> | |
| </reorderable-container-component> |