This gist contains lists of modules available in
in AWS Lambda.
| /** | |
| * Created by daniel on 9/29/2015. | |
| */ | |
| var AWS = require('aws-sdk'); | |
| AWS.config.update({accessKeyId: 'ID', secretAccessKey: 'KEY'}); | |
| AWS.config.update({region: 'us-east-1'}); | |
| var s3 = new AWS.S3(); | |
| var fileType = require('file-type'); | |
| var lwip = require('lwip'); | |
| var uuid = require('node-uuid'); |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css"/> | |
| <style> | |
| #mapid{ | |
| height: 480px; | |
| } | |
| #download { | |
| position:absolute; |
| const toDataURL = url => fetch(url) | |
| .then(response => response.blob()) | |
| .then(blob => new Promise((resolve, reject) => { | |
| const reader = new FileReader() | |
| reader.onloadend = () => resolve(reader.result) | |
| reader.onerror = reject | |
| reader.readAsDataURL(blob) | |
| })) |
| import dropbox | |
| import tinys3 | |
| import tempfile | |
| from string import Template | |
| import random | |
| import string | |
| S3_ACCESS_KEY = "" | |
| S3_SECRET_KEY= "" |
| <button class="pay">Pay</button> | |
| <script src="https://checkout.stripe.com/checkout.js"> | |
| <script> | |
| var handler = StripeCheckout.configure({ | |
| key: window.STRIPE_PUBLICK_KEY, | |
| image: 'https://yourlogo.png', | |
| locale: 'auto', | |
| token: function(token) { | |
| $('.pay').prop("disabled", true); |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| <link rel="stylesheet" type="text/css" href="http://app.englishpatient.org/assets/css/semantic.min.css"> |
| /* | |
| * Algorithmia Lambda Sample Code | |
| */ | |
| var AWS = require('aws-sdk'); | |
| var apiKey = 'YOUR_API_KEY_HERE' | |
| exports.handler = function (event, context) { | |
| // Specify the target algorithm | |
| var algo = "algo://besirkurtulmus/quadtree_art/0.1.x"; |
This gist contains lists of modules available in
in AWS Lambda.
| // dependencies | |
| var async = require('async'); | |
| var path = require('path'); | |
| var AWS = require('aws-sdk'); | |
| var gm = require('gm').subClass({ | |
| imageMagick: true | |
| }); | |
| var util = require('util'); | |
| // get reference to S3 client | |
| var s3 = new AWS.S3(); |
| module['exports'] = function imageResize (hook, callback) { | |
| // GraphicsMagick fully supported | |
| var gm = require('gm'); | |
| // for a more complete example that supports file uploads and streaming uploads | |
| // see: http://image.resize.hook.io | |
| // grab an image as a url | |
| // no file has been uploaded, fallback to the image "url" parameter | |
| var stream = hook.open('https://hook.io/img/robotcat.png'); | |
| hook.res.writeHead(200, { 'Content-Type': 'image/png' }); | |
| gm(stream) |