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
<template> | |
<v-dialog v-model="dialog" :max-width="options.width" @keydown.esc="cancel" v-bind:style="{ zIndex: options.zIndex }"> | |
<v-card> | |
<v-toolbar dark :color="options.color" dense flat> | |
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title> | |
</v-toolbar> | |
<v-card-text v-show="!!message">{{ message }}</v-card-text> | |
<v-card-actions class="pt-0"> | |
<v-spacer></v-spacer> | |
<v-btn color="primary darken-1" flat="flat" @click.native="agree">Yes</v-btn> |
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
var aws = require('aws-sdk'); | |
var s3 = new aws.S3(); | |
var params = { | |
Bucket: 'bucket', | |
Key: 'file.png' // if the file is a in a directory, the key would be: 'directory_name/file_name.ext' | |
}; | |
s3.deleteObject(params, (err, data) => { | |
if (err) { | |
console.error(err) |
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'); | |
const s3 = new aws.S3(); | |
var params = { | |
Bucket: 'bucket_name', | |
Key: 'file.png', // if you want to put in a directory, the key would be: 'directory_name/file_name.ext' | |
ACL: 'public-read', // to allow to access the file | |
Body: data // the data of the file | |
}; | |
s3.putObject(params, (err, data) => { |
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
var aws = require('aws-sdk'); | |
var s3 = new aws.S3(); | |
var params = { | |
Bucket: 'node-sdk-sample-7271', | |
Delete: { // required | |
Objects: [ // required | |
{ | |
Key: 'foo.jpg' // required, if in a directory: 'directory_name/file.ext' | |
}, |
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
// will return the last day of the month = the number of days in a month | |
function daysInMonth(anyDateInMonth) { | |
return new Date(anyDateInMonth.getFullYear(), anyDateInMonth.getMonth() + 1, 0).getDate(); | |
} | |
let dayInNovember2017 = new Date(2017, 10, 1); // 2017-11-01 | |
console.log(daysInMonth(dayInNovember2017)); // 30 days |