Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace ConsoleApplication2 | |
| { | |
| class Derived | |
| { |
| using System; | |
| using System.IO; | |
| using System.Text; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace SomeNamespace.Controllers | |
| { | |
| public class ImagesController : Controller | |
| { |
| sudo apt-get install ubuntu-desktop | |
| sudo apt-get install gnome-desktop-environment | |
| For KDE change gnome-desktop-environment to kubuntu-desktop. | |
| For XFCE enter xubuntu-desktop. |
| PowerShellGet\Install-Module posh-git -Scope CurrentUser | |
| Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm | |
| Import-Module posh-git | |
| Add-PoshGitToProfile |
| code -n [open new instance] | |
| code -r [reuse instance] | |
| code -folder path [open folder] | |
| code -file path [open file] |
| #stop all containers: | |
| docker kill $(docker ps -q) | |
| #remove all containers | |
| docker rm $(docker ps -a -q) | |
| #remove all docker images | |
| docker rmi $(docker images -q) | |
| #remove all docker volumes |
Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
| aws --endpoint-url=http://localhost:4572 s3 mb s3://demo-bucket | |
| aws --endpoint-url=http://localhost:4572 s3api put-bucket-acl --bucket demo-bucket --acl public-read | |
| aws --endpoint-url="http://localhost:4572" s3 ls |
| const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
| const asyncForEach = async (array, callback) => { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } | |
| const start = async () => { | |
| await asyncForEach([1, 2, 3], async (num) => { | |
| await waitFor(50) |
| // under Google Chrome 36 | |
| Object.prototype.toString.call([]) | |
| // "[object Array]" | |
| Object.prototype.toString.call(function(){}) | |
| // "[object Function]" | |
| Object.prototype.toString.call({}) | |
| // "[object Object]" | |
| Object.prototype.toString.call(null) | |
| // "[object Null]" |