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
| {application, relay, | |
| [{description, "relay"}, | |
| {vsn, "0.01"}, | |
| {modules, [ | |
| relay_app, | |
| relay_listener, | |
| relay_sup, | |
| relay_worker | |
| ]}, | |
| {registered, []}, |
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
| func f() error { | |
| // might return an error | |
| } | |
| func somethingElse() { | |
| switch err := f(); err { | |
| case mgo.ErrNotFound: | |
| // a specific error that is recoverable | |
| case nil: | |
| // no error occurred. Usually this is just a break statement. |
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
| @implementation BroadcastTableViewController | |
| // ... | |
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object { | |
| // ... | |
| cell.dateLabel.text = [NSDateFormatter localizedStringFromDate:object.createdAt | |
| dateStyle:NSDateFormatterMediumStyle | |
| timeStyle:NSDateFormatterShortStyle]; | |
| cell.ownerLabel.hidden = ![[(PFUser *)object[@"owner"] objectId] isEqual:[[PFUser currentUser] objectId]];; | |
| return cell; |
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
| Parse.Cloud.define("NearByAds", nearByAds); | |
| Parse.Cloud.define("myAds", myAds); | |
| var locationUtil = require('cloud/latlon.js'); | |
| /* | |
| * limit is kInitialObjectsPerPageNum(100) | |
| * oredered by descending adDate and createdAt | |
| * kSpecialPropertyKeyApproved(approved) is YES | |
| * kSpecialPropertyKeyDeleted(deleted) is NO |
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
| 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 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
| // in invite.js module: | |
| exports.inviteUser = function(creatingUser,email,tempPass,response) | |
| { | |
| "use strict"; | |
| if (!tempPass) { | |
| tempPass = genRandomPass(); | |
| } | |
| var user = new Parse.User(); | |
| user.set ("username", email); |
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
| package main | |
| import ( | |
| "crypto/rand" | |
| "crypto/sha1" | |
| "code.google.com/p/go.crypto/pbkdf2" | |
| "bytes" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" | |
| ) |
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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" | |
| "net/http" | |
| ) |
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
| package main | |
| import ( | |
| "fmt" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" | |
| "time" | |
| ) | |
| type Person struct { |
OlderNewer