This file contains 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
// Parse.com Cloud Code | |
Parse.Cloud.define('getMessagesForUser', function(request, response) { | |
var user = Parse.User.current(); | |
var query = new Parse.Query('Messages'); | |
query.equalTo('recipient', user); | |
query.find() | |
.then(function(messages) { | |
response.success(messages); | |
}); |
This file contains 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
// Parse Server Cloud Code | |
Parse.Cloud.define('getMessagesForUser', function(request, response) { | |
var user = request.user; // request.user replaces Parse.User.current() | |
var token = user.getSessionToken(); // get session token from request.user | |
var query = new Parse.Query('Messages'); | |
query.equalTo('recipient', user); | |
query.find({ sessionToken: token }) // pass the session token to find() | |
.then(function(messages) { | |
response.success(messages); |
This file contains 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
// Parse.com Cloud Code | |
Parse.Cloud.define('getTotalMessageCount', function(request, response( { | |
Parse.Cloud.useMasterKey() // This should not longer be used! | |
var query = new Parse.Query('Messages'); | |
query.count() | |
.then(function(count) { | |
response.success(count); | |
}); | |
}); |
This file contains 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
// Parse Server Cloud Code | |
Parse.Cloud.define('getTotalMessageCount', function(request, response) { | |
var query = new Parse.Query('Messages'); | |
query.count({ useMasterKey: true }) // count() will use the master key to bypass ACLs | |
.then(function(count) { | |
response.success(count); | |
}); | |
}); |
This file contains 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
<?php | |
/* ====================================================== | |
This script is NOT FULLY TESTED (not tested on Windows Server either) | |
USE AT YOUR OWN RISK - development environment Ubuntu Linux 14.04.3 LTS | |
The purpose of this script is for small websites and blogs | |
to have their existing media to work through Amazon S3 | |
There's a great plugin, WP Offload S3, that we'll be tapping | |
into...it works great for new media, but this is a quick |
This file contains 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
// Parse Server Cloud Code | |
Parse.Cloud.define('getTotalMessageCount', function(request, response) { | |
var query = new Parse.Query('Messages'); | |
query.count({ useMasterKey: true }) // count() will use the master key to bypass ACLs | |
.then(function(count) { | |
response.success(count); | |
}); |
This file contains 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
cloud | |
- src | |
- tsconfig.json | |
public | |
- css | |
- index.html | |
.gitignore | |
index.js | |
package.json | |
README.md |
This file contains 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
/* | |
* Advanced Cloud Code Example | |
*/ | |
const connect = require('connect') | |
const serveStatic = require('serve-static') | |
const vhost = require('vhost') | |
const express = require('express'); | |
const app = express(); |
This file contains 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
<!DOCTYPE html> | |
<!-- This page is displayed when someone navigates to a verify email or reset password link | |
but their security token is wrong. This can either mean the user has clicked on a | |
stale link (i.e. re-click on a password reset link after resetting their password) or | |
(rarely) this could be a sign of a malicious user trying to tamper with your app. | |
--> | |
<html> | |
<head> | |
<title>Invalid Link</title> | |
<style type='text/css'> |
This file contains 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
<!doctype html> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript"> | |
function injectInHead({ | |
targetId = "corllete", | |
src, | |
type, | |
loadTimeout = 0, |
OlderNewer