This file contains hidden or 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 timestamp = Math.floor(new Date() / 1000); |
This file contains hidden or 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
// adapted from http://stackoverflow.com/a/1349426/5573841 | |
function generateRandomString(desiredLengthOfRandomString) { | |
var result = ''; | |
var possibleCharactersForRandomString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for( var i=0; i < desiredLengthOfRandomString; i++ ) | |
result += possibleCharactersForRandomString.charAt(Math.floor(Math.random() * possibleCharactersForRandomString.length)); | |
return result; | |
} |
This file contains hidden or 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 string = "This is a string"; | |
var encodedString = new Buffer(string).toString('base64'); |
This file contains hidden or 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 twitterHandle = ""; | |
var bestAvailableImage = ""; | |
if(input.user_twitter_link){ | |
var indexOfLastSlash = input.user_twitter_link.lastIndexOf('/'); | |
twitterHandle = input.user_twitter_link.substring(indexOfLastSlash + 1); | |
twitterHandle = '(@' + twitterHandle + ')'; | |
} | |
if(input.hidpi_image){ |
This file contains hidden or 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 apiUrl = 'ENTER_THE_API_URL_HERE'; | |
var data = JSON.stringify({ | |
"key1": "value1", | |
"key2": "value2" | |
}); | |
fetch(apiUrl, { | |
method: 'POST', | |
body: data, |
This file contains hidden or 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
// You can find all three of these in the "Account Details" section of your Cloudinary Dashboard. | |
var cloudinaryCloudName = ""; | |
var cloudinaryApiKey = ""; | |
var cloudinaryApiSecret = ""; | |
// Upload a semi-transparent PNG file to your Cloudinary account. This semi-transparent image will be used as the watermark. Then, enter the name (Public ID) of that image below. Learn more at http://cloudinary.com/blog/adding_watermarks_credits_badges_and_text_overlays_to_images | |
var watermarkImageName = ""; | |
This file contains hidden or 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
/*To get the Trello checklist ID... | |
1. Open the card that contains the checklist | |
2. In the right sidebar of the card, click on "Share and more" | |
3. Click "Export JSON" | |
4. Select all of that JSON and Copy it to your clipboard | |
5. Go to http://www.jsoneditoronline.org/ | |
6. Paste in the JSON in the box on the left | |
7. Click the right arrow [>] button | |
8. On the right side, scroll down until you see the "checklists" key, then click the arrows to expand that section | |
9. Use the "name" key find the correct checklist, then copy the "id" value of that checklist |
This file contains hidden or 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
/* | |
EXAMPLE: | |
input.tweetContent = This is a tweet about Zapier that mentions @zapier twice as well as reganstarr. | |
*/ | |
var commaSeperatedTwitterUsernames = "Zapier,ReganStarr"; | |
// You'll need to change input.tweetContent to match whatever input mapping you defined in the "Input" section of Zapier. (https://zapier.com/help/code/#how-does-it-work) | |
var tweetContent = input.tweetContent; |
This file contains hidden or 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 username = ''; | |
var password = ''; | |
var encoded_credentials = new Buffer(username + ':' + password).toString('base64'); | |
fetch('https://example.com', { method: 'POST', headers: {'Authorization': 'Basic ' + encoded_credentials} }) | |
.then(function(res) { | |
return res.json(); | |
}) | |
.then(function(body) { |