Skip to content

Instantly share code, notes, and snippets.

const p = Promise.resolve();
(async ()=> {
await p;
console.log('after:await');
})();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>
<ItemGroup>
<None Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
@RoyiNamir
RoyiNamir / 1
Created February 16, 2019 14:24
console.log('Loading function');
var AWS = require('aws-sdk');
var dynamo = new AWS.DynamoDB.DocumentClient();
exports.handler = async (event, context, callback) =>
{
"workbench.colorCustomizations": {
//"editor.selectionBackground": "#13ff0b83",
"editor.selectionHighlightBackground": "#13ff0b9a",
"editor.lineHighlightBackground": "#2b373a70",
"editor.wordHighlightBackground": "#13ff0b9a",
"editor.findMatchHighlightBackground": "#00ecfdb0",
"editor.wordHighlightStrongBackground": "#f812c68f", // syntax variable assignment
ment';
get isLoggedIn(): boolean {
return this.authService.isLoggedIn();
}
get userName(): string {
if (this.authService.currentUser) {
@RoyiNamir
RoyiNamir / asd
Last active January 14, 2019 20:17
1.cs
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
namespace ConsoleApp2.Models
{
public partial class MyContext : DbContext
{
public MyContext()
{
//Install express server2
import express from 'express';
import * as url from 'url';
const sharp = require('sharp');
var request = require('request');
export {};
var cors = require('cors');
import puppeteer, {ElementHandle, Page} from "puppeteer";
import {LOGIN_URL, USER} from "./models/consts";
import {IUser} from "./models/i-user";
const getPropAsync = async (elementHandle: ElementHandle, propertyName: string) =>
{
let href = await elementHandle.getProperty(propertyName);
return await (await elementHandle.getProperty(propertyName)).jsonValue();
};
import puppeteer, {ElementHandle} from "puppeteer";
const getPropAsync = async (elementHandle: ElementHandle, propertyName: string) =>
{
let href = await elementHandle.getProperty(propertyName);
return await (await elementHandle.getProperty(propertyName)).jsonValue();
};
const getElementsAsync = (async (selector: string, section: ElementHandle | null, propertyName: string | null, page) =>
{
let cubes: ElementHandle[] = [];
import puppeteer, {ElementHandle} from "puppeteer";
(async () =>
{
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
let url = "https://www.mutualart.com/Artists";
console.log(`Fetching page data for : ${url}...`);
await page.goto(url);