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.Cloud.define("loadChannelsFromDate", function(request, response) { | |
var fromDate = request.params.fromDate; | |
var toDate = request.params.toDate; | |
var count = request.params.count; | |
var query = new Parse.Query("archupObject"); | |
query.limit = count; | |
if(fromDate){ | |
query.greaterThan("updatedAt", fromDate); |
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
- (IBAction)loginButtonTouchHandler:(id)sender{ | |
NSArray *permissionsArray = @[@"user_about_me"]; | |
[PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) { | |
if (!user) { | |
if (!error) { | |
NSLog(@"Uh oh. The user cancelled the Facebook login."); | |
} else { | |
NSLog(@"Uh oh. An error occurred: %@", error); | |
} |
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
UIImage *resizedImage = [anImage resizedImageWithContentMode:UIViewContentModeScaleAspectFit bounds:CGSizeMake(1152.0f, 1536.0f) interpolationQuality:kCGInterpolationHigh]; | |
// JPEG to decrease file size and enable faster uploads & downloads | |
NSData *imageData = UIImageJPEGRepresentation(resizedImage, 0.8f); | |
PFFile* photoFile = [PFFile fileWithData:imageData]; | |
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
PFQuery *queryPhoto = [PFQuery queryWithClassName:@"Photo"]; | |
[queryPhoto whereKey:@”user” equalTo:[PFUser currentUser]]; | |
[queryPhoto orderByDescending:@"createdAt"]; | |
[queryPhoto findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { | |
//handle sketches | |
} |
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
-(void) mirroringX1:(float)x1 y1:(float)y1 x2:(float)x2 y2:(float)y2{ | |
float mirrorNumber = totalLines; | |
float deltaAngle = 360 / mirrorNumber; | |
float deltaAngleRadian = [self degreesToRadian:deltaAngle]; | |
float centerX = self.frame.size.width / 2; | |
float centerY = self.frame.size.height / 2; | |
float distance1 = [self distX1:x1 y1:y1 x2:centerX y2:centerY]; |
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.initialize(KEY, SECRET); | |
var Photo = Parse.Object.extend("Photo"); | |
var query = new Parse.Query(Photo); | |
query.equalTo("user", Parse.User.current()); | |
query.descending("createdAt"); | |
query.find({ | |
success: function(photosArr) { | |
//show images |
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.initialize(KEY, SECRET); | |
window.fbAsyncInit = function() { | |
// init the FB JS SDK | |
Parse.FacebookUtils.init({ | |
appId : '1386686244890246', // App ID from the app dashboard | |
channelUrl : 'channel.html', // Channel file for x-domain comms | |
status : false, // check login status | |
cookie : true, // enable cookies to allow Parse to access the session |
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
module['exports'] = function highFive(hook) { | |
// hook.io has a range of node modules available - see | |
// https://hook.io/modules. | |
// We use request (https://www.npmjs.com/package/request) for an easy way to | |
// make the HTTP request. | |
var request = require('request'); | |
// The parameters passed in via the slash command POST request. | |
var params = hook.params; |
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
// 1. Enter sheet name where data is to be written below | |
var SHEET_NAME = "Other"; | |
// 2. Run > setup | |
// | |
// 3. Publish > Deploy as web app | |
// - enter Project Version name and click 'Save New Version' | |
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously) | |
// | |
// 4. Copy the 'Current web app URL' and post this in your form/script action |
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
var settings; | |
var email; | |
var id; | |
loadSavedSettings(); | |
function loadSavedSettings() { | |
// buttonSettings | |
if (!window.localStorage.buttonSettings) { |
OlderNewer