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
| const pgp = require('pg-promise')({}); | |
| const db = pgp(process.env.DATABASE_URL); | |
| /* | |
| * Get access token. | |
| */ | |
| module.exports.getAccessToken = function(bearerToken) { | |
| return db.query('SELECT otk_token_acesso, otk_token_expira_em, otk_ocl_id, otk_refresh_token, otk_refresh_token_expira_em, otk_usr_id FROM otk_oauth_tokens WHERE otk_token_acesso = $1', [bearerToken]) | |
| .then(function(result) { |
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" | |
| "github.com/julienschmidt/httprouter" | |
| "log" | |
| "net/http" | |
| "os" | |
| "strconv" | |
| ) |
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 ( | |
| "github.com/go-martini/martini" | |
| "github.com/martini-contrib/render" | |
| "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 signatures | |
| import ( | |
| "github.com/go-martini/martini" | |
| "github.com/martini-contrib/binding" | |
| "github.com/martini-contrib/render" | |
| "labix.org/v2/mgo" | |
| ) | |
| type Server *martini.ClassicMartini |
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.beforeSave('Post', function (request, respond) { | |
| var post = request.object; | |
| var prevCatId = post.get('prevCat').id; | |
| var catId = post.get('cat').id; | |
| if (post.dirty('cat')) { | |
| var prev = new Parse.Query('Category'); | |
| prev.get(prevCatId, { | |
| success: function (category) { | |
| // Decrement old category post count. |
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" | |
| "github.com/codegangsta/martini" | |
| "github.com/martini-contrib/binding" | |
| "github.com/martini-contrib/render" | |
| "github.com/martini-contrib/secure" | |
| "github.com/martini-contrib/sessions" | |
| "github.com/ottemo/ottemo-go/auth" |
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("friends", function(request, response){ | |
| var query = new Parse.Query("User"); | |
| query.containedIn("facebook_id", request.params.facebook_ids_array); | |
| query.find({ | |
| success: function(results){ | |
| var friendIDs = new Array(); | |
| for (var i = 0; i < results.length; i++) | |
| { | |
| friendIDs.push(results[i].get('facebook_id')); | |
| } |
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
| [PFCloud callFunctionInBackground:@"capability" | |
| withParameters:nil | |
| block:^(NSString *token, NSError *error) { | |
| TCDevice *device = [TCDevice initWithTokenOrWhateverIForget:token]; | |
| }]; |
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 ( | |
| "flag" | |
| "fmt" | |
| "github.com/globocom/tsuru/db/storage" | |
| "github.com/gorilla/feeds" | |
| "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" | |
| "log" | |
| "os" | |
| "strings" | |
| "text/tabwriter" |
NewerOlder