Skip to content

Instantly share code, notes, and snippets.

View stephanelpaul's full-sized avatar
🌍

Stephane Leandre Paul stephanelpaul

🌍
View GitHub Profile
@congjf
congjf / .Title
Last active April 2, 2023 00:57 — forked from border/mgoExample.go
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
@aleclarson
aleclarson / index.html
Last active August 29, 2015 13:56
OAuth Signing an HTTP request to Twitter's REST API v1.1 via Parse Cloud Code
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript" src="https://cdn.jsdelivr.net/parse/1.2.9/parse.min.js"></script>
<script>
Parse.initialize('parse app id', 'parse app key');
Parse.Cloud.run('userFriends')
.always(function (res) {
console.log(JSON.parse(res.message));
@flovilmart
flovilmart / ParseFacebook.js
Created February 9, 2014 22:01
Parse / Facebook wrapper
var FacebookAPI = function(app_id, app_secret) {
return {
auth_url : "https://graph.facebook.com/oauth/access_token?"+
"client_id=" + app_id +
"&client_secret=" + app_secret +
"&grant_type=client_credentials",
setAppToken: function(app_token){
this.app_token = app_token;
@rgarcia
rgarcia / db_stats.go
Last active August 30, 2016 09:42
mongo db stats
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"log"
"os"
"strings"
"text/tabwriter"
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"
[PFCloud callFunctionInBackground:@"capability"
withParameters:nil
block:^(NSString *token, NSError *error) {
TCDevice *device = [TCDevice initWithTokenOrWhateverIForget:token];
}];
@altyus
altyus / gist:10223831
Created April 9, 2014 03:35
Parse Cloud code to get Post objects for in network friends with passed in facebook IDs
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'));
}
@vastbinderj
vastbinderj / ottemo.go
Created April 9, 2014 15:14
ottemo-create-user-func
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"
@keithio
keithio / post.js
Last active August 29, 2015 14:00
Parse.Object.previous() workaround for Parse.Cloud.beforeSave()
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.
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