This file contains 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
{ | |
"source":{ | |
"include":["src"], | |
"includePattern":".js$", | |
"excludePattern":"(node_modules/|docs)" | |
}, | |
"plugins":["plugins/markdown"], | |
"templates":{ | |
"cleverLinks":true, | |
"monospaceLinks":true |
This file contains 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 kullaniciOlustur | |
* @param {string} isim - Kullanıcı ismi | |
* @param {string} soyisim - Kullanıcı soyismi | |
* @param {number} yas - Kullanıcı yaşı | |
* @return Kullanıcı oluşturuldu | |
* @see https://github.com/basyusuf | |
*/ | |
const kullaniciOlustur = (isim, soyisim, yas) => { | |
console.log(isim); | |
console.log(soyisim); |
This file contains 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
service: screenshotproject | |
frameworkVersion: '2' | |
custom: | |
bucket: screenshot-buckets-test # Sizin oluşturduğunuz bucket'ın ismi | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
region: eu-central-1 | |
iamRoleStatements: | |
- Effect: Allow |
This file contains 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
const chromium = require('chrome-aws-lambda'); | |
const AWS = require('aws-sdk'); | |
const BUCKET_NAME = "screenshot-buckets-test"; | |
AWS.config.region = 'eu-central-1'; |
This file contains 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
const putObjectToS3 = async(key, data) => { | |
console.info("Starting PutObject S3"); | |
let s3Bucket = new AWS.S3(); | |
let params = { | |
Bucket: BUCKET_NAME, | |
Key: key, | |
Body: data, | |
ContentEncoding: 'base64', | |
ContentType: 'image/jpeg', | |
ACL: 'public-read' |
This file contains 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
exports.main = async (event, context, callback) => { | |
console.info("Request Event:", event); | |
let browser = null; | |
let responseBody = {}; | |
let bucketDomain = "https://screenshot-buckets-test.s3.eu-central-1.amazonaws.com/"; | |
let imageUniqueName; | |
const parsed_body = JSON.parse(event.body); | |
const PAGE_URL = parsed_body.page_url; | |
try { |
This file contains 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
[ | |
{ | |
"city": "Istanbul", | |
"lat": "41.0100", | |
"lng": "28.9603", | |
"admin_name": "İstanbul", | |
"capital": "admin", | |
"population": "15154000", | |
"population_proper": "15029231" | |
}, |
This file contains 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
const AWS = require('aws-sdk'); | |
AWS.config.update({region:'eu-central-1'}); | |
const fs = require('fs'); | |
const TABLE_NAME = "YOURTABLENAME"; | |
const docClient = new AWS.DynamoDB.DocumentClient({ | |
"sslEnabled": false, | |
"paramValidation": false, | |
"convertResponseTypes": false, | |
"convertEmptyValues": true |
This file contains 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
let transferAmount = body.amount; | |
let currentBalance = user.getBalance(); | |
if (transferAmount <= currentBalance) { | |
// Complete the transfer | |
} else { | |
// Unsuccessful transfer. Blocked | |
} |
This file contains 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
class Redis { | |
private id: number; | |
private base_url: string; | |
private port: number; | |
constructor(base_url: string, port: number = 6379) { | |
this.base_url = base_url; | |
this.port = port; | |
this.id = new Date().getTime(); | |
} | |
connect() { |
OlderNewer