Skip to content

Instantly share code, notes, and snippets.

View davimacedo's full-sized avatar

Antonio Davi Macedo Coelho de Castro davimacedo

View GitHub Profile
@davimacedo
davimacedo / curl.sh
Last active June 23, 2021 21:33
Example of importing data with cloud functions. See a live example at https://www.back4app.com/database/davimacedo/parse-import-example
curl -X POST \
-H "X-Parse-Application-Id: LL9oIdzIkmwl5xyowQQu0fTmXyUWfet9RuAzwHfj" \
-H "X-Parse-REST-API-Key: R3S8PYQKuzeV4c8MUeO5ved46C50MEp56boDHW1O" \
-H "Content-Type: application/json" \
-d @data.json \
https://parseapi.back4app.com/functions/import
@davimacedo
davimacedo / main.js
Created May 20, 2016 23:33
Cloud code for braintree integration
// Requiring npm module
var braintree = require("braintree");
// Initializing gateway
var gateway = braintree.connect({
environment: braintree.Environment.Sandbox,
merchantId: "useYourMerchantId",
publicKey: "useYourPublicKey",
privateKey: "useYourPrivateKey"
});
@davimacedo
davimacedo / curl.sh
Created May 27, 2016 00:18
Example of exporting data with cloud functions
curl -X POST \
-H "X-Parse-Application-Id: YKjNQyNBBsaJpRlcSRxBfR3yKCGdU395XzZfqjdB" \
-H "X-Parse-REST-API-Key: JBDMxg9uyvbq7FQdd44EtSKDLdDlIrRrP6EIvFZJ" \
-H "Content-Type: application/json" \
-d '{"exportClass": "MyClass"}' \
https://parseapi.back4app.com/functions/export > out.json
@davimacedo
davimacedo / livequery.js
Created November 25, 2016 22:59
Live Query Example
// In order to use it:
// Create an app in back4app, create a class called Message with a column called text, activate web hosting + live query for this class
// Create a new folder and go to it
// Place curent code in a file called livequery.js
// run: npm install parse
// run: node ./livequery
// Then you can create, update and delete entries in dashboard and see the results in your console
var Parse = require('parse/node');
@davimacedo
davimacedo / index.html
Last active October 27, 2017 19:02
This is an example of HTML file with Parse SDK
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="Back4App Inc" name="author">
<title>Sample App| JavaScript Quickstart | Back4App</title>