This gist contains lists of modules available in
in AWS Lambda.
var widget = uploadcare.Widget('[role=uploadcare-uploader]'); | |
widget.onUploadComplete(function (response) { | |
if(response) { | |
uploadcare.loadFileGroup(response.uuid) | |
.done(function(fileGroup) { | |
// Group creation completed successfully. | |
var files = fileGroup.files(); | |
$.each(files, function(i, file) { | |
// Wait for file uploading. |
{% if cart.attributes.yourCartAttribute %} | |
<script> | |
$.ajax({ | |
type: 'POST', | |
url: '/cart/update.js', | |
data: 'attributes[yourCartAttribute]=', | |
dataType: 'json' | |
}); | |
</script> | |
{% endif %} |
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) |
// 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(); |
This gist contains lists of modules available in
in AWS Lambda.
/* | |
* 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"; |
<!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"> |
<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); |
import dropbox | |
import tinys3 | |
import tempfile | |
from string import Template | |
import random | |
import string | |
S3_ACCESS_KEY = "" | |
S3_SECRET_KEY= "" |
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) | |
})) |