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
// run the script with `npx hardhat run <script>` | |
import path from 'path' | |
import fs from 'fs' | |
import { createHash } from 'crypto' | |
const CSV_FILENAME = "provenance_record.csv" | |
async function main() { | |
// CHANGE THE PATH HERE TO YOUR IMAGE COLLECTION PATH | |
const imageDirectory = path.join(__dirname, '/../../images/output/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
const got = require('got'); | |
exports.handler = function(context, event, callback) { | |
let message = ""; | |
let twiml = new Twilio.twiml.MessagingResponse(); | |
const prompt = event.Body !== undefined ? event.Body.trim() : event["prompt"] | |
got.post('https://api.openai.com/v1/engines/davinci/completions', { | |
json: { | |
"prompt": prompt, |
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
exports.handler = function(context, event, callback) { | |
let travis_payload = JSON.parse(event.payload); | |
let message_body = `${travis_payload.repository.name} \ | |
failed to build after changes pushed by \ | |
${travis_payload.committer_name}`; | |
let client = context.getTwilioClient(); | |
client.messages.create({ | |
to: '+15555555555', // Text this number | |
from: '+15555555555', // From a valid Twilio number |
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
import http.requests.*; | |
String ACCOUNT_SID = "XXXXXXXXXXXXXXXXXXXXXXX"; | |
String AUTH_TOKEN = "YYYYYYYYYYYYYYYYYYYYYYY"; | |
PostRequest post = new PostRequest("https://api.twilio.com/2010-04-01/Accounts/" | |
+ ACCOUNT_SID + "/Messages"); | |
void setup() { | |
post.addData("From", "+15555555555"); | |
post.addData("To", "+15555555555"); |
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
from twilio.rest import TwilioRestClient | |
from twilio.rest.resources import Call | |
ACCOUNT_SID = "YOUR_ACCOUNT_SID" | |
AUTH_TOKEN = "YOUR_AUTH_TOKEN" | |
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN) | |
calls = client.calls.list(status=Call.IN_PROGRESS) # May need to use Call.QUEUED or Call.RINGING | |
for c in calls: | |
c.hangup() |