v: characterShift+v: whole lineCtrl+v: cursor, multiple lines
h,j,k,lf{c}: move toccharacter (useful for characters which would otherwise mess with/regex search:.,,,;,:, etc.)
| [ | |
| { | |
| "id": "get-result", | |
| "routes": ["get-result:get-result-actual"] | |
| } | |
| ] |
| import Instagram from 'instagram-web-api'; | |
| (async () => { | |
| const username = process.env.IG_USERNAME; | |
| const password = process.env.IG_PASSWORD; | |
| const client = new Instagram({ username, password }); | |
| await client.login(); | |
| const photos = await client.getPhotosByUsername({ username, first: 50 }); | |
| photos.user.edge_owner_to_timeline_media.edges.map(async edge => { |
| const nest = (items, parent = 0) => { | |
| const nested = []; | |
| Object.values(items).forEach(item => { | |
| // parent can be a string or a number | |
| /* eslint-disable-next-line eqeqeq */ | |
| if (item.parent == parent) { | |
| const children = nest(items, item.id); | |
| if (children.length) { |
| #!/usr/bin/env node | |
| const path = require('path'); | |
| const https = require('https'); | |
| const AWS = require('aws-sdk'); | |
| const promisePipe = require('promisepipe'); | |
| const unzip = require('unzipper'); | |
| const runner = async () => { |
| const runParams = { | |
| taskDefinition: RUNNER, | |
| launchType: "FARGATE", | |
| networkConfiguration: { | |
| awsvpcConfiguration: { | |
| assignPublicIp: "ENABLED", | |
| subnets: [SUBNET] | |
| } | |
| }, | |
| overrides: { |
| const runParams = { | |
| taskDefinition: RUNNER, | |
| launchType: "FARGATE", | |
| networkConfiguration: { | |
| awsvpcConfiguration: { | |
| assignPublicIp: "ENABLED", | |
| subnets: [SUBNET] | |
| } |
| #!/usr/bin/env node | |
| const path = require('path'); | |
| const https = require('https'); | |
| const AWS = require('aws-sdk'); | |
| const promisePipe = require('promisepipe'); | |
| const unzip = require('unzip'); | |
| const { argv } = require('yargs'); |
| FROM node:8 | |
| # Environment variables acting as parameters of the runner. | |
| ENV AWS_LAMBDA_FUNCTION_EVENT {} | |
| ENV AWS_LAMBDA_FUNCTION_CONTEXT {} | |
| # Create app directory | |
| WORKDIR /usr/src/app | |
| COPY . . |
| import AWS from 'aws-sdk'; | |
| export const handler = async (event, context, callback) => { | |
| // Coming from environment variables setup in your `serverless.yaml` file | |
| // See https://serverless.com/framework/docs/providers/aws/guide/variables/#referencing-environment-variables | |
| const { RUNNER, SUBNET } = process.env; | |
| const ecs = new AWS.ECS(); | |
| // Some other logic specific to your case here ... |