def create_user_table():
"""Create the user table."""
try:
result = client.create_table(
TableName='user_table',
BillingMode='PAY_PER_REQUEST',
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 nodemailer = require('nodemailer'); | |
const sendEmail = async ({to, subject, message, from}) => { | |
const transporter = nodemailer.createTransport({ | |
host: process.env.AWS_SMTP_HOST, | |
port: process.env.AWS_SMTP_PORT, | |
secure: false, | |
auth: { | |
user: process.env.AWS_SMTP_USER, // generated ethereal user | |
pass: process.env.AWS_SMTP_PASS, // generated ethereal password |
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 path = require('path'); | |
const TerserPlugin = require("terser-webpack-plugin"); | |
module.exports = { | |
mode: 'development', | |
watchOptions: { | |
ignored: /node_modules/, | |
}, | |
optimization: { | |
minimize: 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
Array.from(document.querySelectorAll('style, link')).map(x => x.remove()); | |
Array.from(document.querySelectorAll('*')).map(x => { | |
x.setAttribute('stlye', "") | |
}); |
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 files = [ | |
"https://archive.org/download/OTRR_Gunsmoke_Singles/Gunsmoke%2052-04-26%20%28001%29%20Billy%20the%20Kid.mp3" | |
] | |
const exec = require('child_process').exec; | |
const downloadFile = (url) => { | |
return new Promise((resolve) => { | |
console.log(`wget ${url} --no-check-certificate`) | |
exec(`wget ${url} --no-check-certificate`, function(err, stdout, stderr) { |
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 asyncLocalStorage = { | |
setItem: function (key, value) { | |
return Promise.resolve().then(function () { | |
localStorage.setItem(key, value); | |
}); | |
}, | |
getItem: function (key) { | |
return Promise.resolve().then(function () { | |
return localStorage.getItem(key); | |
}); |
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
window.onerror = function(errorMessage, filePath, lineNumber, offset, stackObject) { | |
console.log(stackObject) | |
console.log({ | |
'errorMessage' : errorMessage, | |
'filePath' : filePath, | |
'lineNumber' : lineNumber, | |
'offset' : offset, | |
'stackObject' : stackObject, | |
}) | |
} |
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
/** | |
* Say you have this: {"key": "123", "limit": 20} | |
* But you need this: ?key=123&limit=20 | |
* Use objectToParams... | |
*/ | |
const objectToParams = (obj) => { | |
const params = Object.keys(obj).reduce((acc, key) => { | |
return `${acc}&${key}=${obj[key]}`; | |
}, ''); | |
return params.replace(/&/, '?'); |
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
[ | |
{ | |
"formatted_address": "211 S Greenwood Ave, Tulsa, OK 74120, United States", | |
"geometry": { | |
"location": { | |
"lat": 36.1567677, | |
"lng": -95.9840401 | |
}, | |
"viewport": { | |
"south": 36.15535762010728, |
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
<!DOCTYPE html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8 /> | |
<meta content="IE=edge" http-equiv=X-UA-Compatible /> | |
<meta content="width=device-width, initial-scale=1" name=viewport /> | |
<title>Schedule | JAMstack_conf_sf</title> | |
<meta content="A two day conference, and a day of workshops in San Francisco for learning to design, develop, & deploy modern web projects without servers." name=description /> | |
<meta content="jamstack, pwa, progressive web apps, apis, api, react, reactjs, react.js, react conf, conference, conf, workshop, netlify, github, eventbrite, webpack, freecodecamp, redux, vue, vue.js, workshop, learn to code, learn to program, learn react, san francisco, learn programming, learn javascript, learn coding, code, coding, programming, software engineer, software developer, web development, development, engineering, coding bootcamp, javascript, open source, microservices, serverless, gatsby, contentful, angular, angular.js, angularjs" name=keywords /> | |
<meta content="https://jamstackconf.com/sf" pr |
NewerOlder