Skip to content

Instantly share code, notes, and snippets.

View jcipriano's full-sized avatar

Jonathan Cipriano jcipriano

View GitHub Profile
@jcipriano
jcipriano / netlify.toml
Last active May 3, 2023 21:34
couchbase-netlify-template
[build]
command = "npm i --verbose && strip --strip-debug ./node_modules/couchbase/build/Release/couchbase_impl.node"
publish = "."
[template.environment]
COUCHBASE_USERNAME = "COUCHBASE_USERNAME"
COUCHBASE_PASSWORD = "COUCHBASE_PASSWORD"
COUCHBASE_ENDPOINT = "COUCHBASE_ENDPOINT"
COUCHBASE_BUCKET = "COUCHBASE_BUCKET"
[template.environment]
VITE_TURSO_DB_URL = "VITE_TURSO_DB_URL"
VITE_TURSO_DB_AUTH_TOKEN = "VITE_TURSO_DB_AUTH_TOKEN"
@jcipriano
jcipriano / moralis-netlify.toml
Last active March 31, 2023 18:39
Define required env variables for Moralis.io on Netlify
[template.environment]
MORALIS_API_KEY = "MORALIS_API_KEY"
NEXTAUTH_SECRET = "NEXTAUTH_SECRET"
@jcipriano
jcipriano / 1-get-accounts.js
Last active May 17, 2019 18:06
Basic Twitter Ads API requests with Node.js
var request = require('request')
// twitter authentication
var twitter_oauth = {
consumer_key: 'your-consumer-key',
consumer_secret: 'your-consumer-secret',
token: 'your-access-token',
token_secret: 'your-access-token-secret'
}
@jcipriano
jcipriano / verify-credentials.js
Created January 10, 2018 19:35
Validates your Twitter consumer keys and tokens by logging requestor's user object.
var request = require('request')
// twitter authentication
var twitter_oauth = {
consumer_key: 'TWITTER_CONSUMER_KEY',
consumer_secret: 'TWITTER_CONSUMER_SECRET',
token: 'TWITTER_ACCESS_TOKEN',
token_secret: 'TWITTER_ACCESS_TOKEN_SECRET'
}
@jcipriano
jcipriano / send-dm-share-button.js
Created December 4, 2017 23:19
Prompts a user to share via Tweet compose from a Direct Message with Node.js.
var nconf = require('nconf')
var request = require('request')
// load config
nconf.file({ file: 'config.json' }).env()
// twitter authentication
var twitter_oauth = {
consumer_key: nconf.get('TWITTER_CONSUMER_KEY'),
@jcipriano
jcipriano / delete-webhook-config.js
Last active November 16, 2017 19:01
Deletes an Account Activity API webhook config.
var request = require('request')
// twitter authentication
var twitter_oauth = {
consumer_key: 'redacted',
consumer_secret: 'redacted',
token: 'redacted',
token_secret: 'redacted'
}
@jcipriano
jcipriano / get-subscriptions-list.js
Created November 13, 2017 19:31
Retrieves webhook subscriptions for Twitter Account Activity API.
var nconf = require('nconf')
var request = require('request')
// load config
nconf.file({ file: 'config.json' }).env()
// twitter authentication
var twitter_oauth = {
consumer_key: 'redacted',
@jcipriano
jcipriano / save-dm-image.js
Last active November 2, 2017 18:12
Accesses and saves to disk an image in a Twitter Direct Message.
var request = require('request')
var fs = require("fs")
// twitter authentication
var twitter_oauth = {
consumer_key: 'redacted',
consumer_secret: 'redacted',
token: 'redacted',
token_secret: 'redacted'
}
@jcipriano
jcipriano / verify-credentials.js
Created August 30, 2017 18:10
Verifies Twitter credentials.
var nconf = require('nconf')
var request = require('request')
// load config
nconf.file({ file: 'config.json' }).env()
// twitter authentication
var twitter_oauth = {
consumer_key: nconf.get('TWITTER_CONSUMER_KEY'),