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
| function getDistinctObjectsBasedUponPropertyValue(array, distinctProperty) { | |
| var tempArray = [] | |
| return array.filter(function (n) { | |
| return tempArray.indexOf(n[distinctProperty]) == -1 && tempArray.push(n[distinctProperty]) | |
| }) | |
| } |
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
| // CORS middleware function (this will allow any host to be able to send requests) | |
| function allowCors(req, res, next) { | |
| res.header("Access-Control-Allow-Origin", "*"); | |
| res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | |
| next(); | |
| } | |
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
| # instantiate it | |
| getVeeamLinks = lambda z: {dic["Type"] : dic["Href"] for dic in z for key in dic.keys() if key == 'Type'} | |
| # invoke it | |
| allLinks = getVeeamLinks(lod) # where 'lod' is your list of dicts | |
| print(allLinks) |
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 id="app"> | |
| <div> | |
| <current-ip @ip-changed="$set(ips, 'first', $event)"></current-ip> | |
| <current-latitude :ip="ips['first']"></current-latitude> | |
| <hr /> | |
| <current-ip | |
| ip="4.2.2.2" | |
| @ip-changed="$set(ips, 'second', $event)"></current-ip> | |
| <current-latitude :ip="ips['second']"></current-latitude> | |
| </div> |
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
| function Set-ADSIUser | |
| { | |
| <# | |
| .SYNOPSIS | |
| This function modifies an account identified by its display name, sam account name or distinguished name. | |
| .DESCRIPTION | |
| This function modifies an account identified by its display name, sam account name or distinguished name. | |
| .PARAMETER Identity |
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
| node { | |
| def app | |
| def dockerhub_container = "oze4/node-api" | |
| def local_container_name = "node-api" | |
| def docker_compose_path = "/srv/traefik/docker-compose/" | |
| stage('Clone Repository') { | |
| deleteDir() | |
| checkout scm | |
| } |
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
| FROM node:lts-alpine AS build-stage | |
| WORKDIR /app | |
| COPY package*.json ./ | |
| RUN npm install | |
| COPY . . | |
| RUN npm run build | |
| FROM nginx:stable-alpine | |
| COPY --from=build-stage /app/dist /usr/share/nginx/html | |
| # this isn't necessary - you don't have to expose a port here |
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
| # Create a container from the mongo image, | |
| # run is as a daemon (-d), expose the port 27017 (-p), | |
| # set it to auto start (--restart) | |
| # and with mongo authentication (--auth) | |
| # Image used is https://hub.docker.com/_/mongo/ | |
| docker pull mongo | |
| docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth | |
| # Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception) | |
| # add a root user |
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
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| root /usr/share/nginx/html; | |
| index index.html; | |
| location / { | |
| # Support the HTML5 History mode of the vue-router. |
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
| // Change time zone | |
| System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'America/Chicago') |