Skip to content

Instantly share code, notes, and snippets.

View stephanelpaul's full-sized avatar
🌍

Stephane Leandre Paul stephanelpaul

🌍
View GitHub Profile
@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;
@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));
@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
@polds
polds / mgo_example.go
Created November 11, 2013 10:25
Mgo Example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@jystewart
jystewart / places_of_interest.go
Created November 5, 2013 22:44
Very early proof of concept golang implementation of the GOV.UK Imminence API
package main
import (
"encoding/json"
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"net/http"
)
@veer66
veer66 / user.go
Created November 4, 2013 10:30
User management (incomplete)
package main
import (
"crypto/rand"
"crypto/sha1"
"code.google.com/p/go.crypto/pbkdf2"
"bytes"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
)
@martijnthe
martijnthe / menu_app.c
Created May 19, 2013 01:10
MenuLayer code fragment
#define BUFFER_SIZE 25
static const uint8_t s_music_launcher_icon_pixels[] = {
0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0x01, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, /* bytes 0 - 16 */
0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x18, 0x00, 0x7f, 0x00, 0x1f, 0x00, /* bytes 16 - 32 */
0x7f, 0xf0, 0x1f, 0x00, 0x7f, 0xfc, 0x1f, 0x00, 0x7f, 0xfc, 0x1f, 0x00, 0x7f, 0xfc, 0x1f, 0x00, /* bytes 32 - 48 */
0x7f, 0xfc, 0x1f, 0x00, 0x7f, 0xfc, 0x1f, 0x00, 0x7f, 0xfc, 0x1f, 0x00, 0x7f, 0xfc, 0x1f, 0x00, /* bytes 48 - 64 */
0x7f, 0xfc, 0x1f, 0x00, 0x7f, 0xfc, 0x1f, 0x00, 0x7f, 0xfc, 0x00, 0x00, 0x7f, 0x7c, 0x00, 0x00, /* bytes 64 - 80 */
0x03, 0x3c, 0x00, 0x00, 0x01, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x80, 0x00, 0x00, 0x3c, 0xc0, 0x00, /* bytes 80 - 96 */
@mikevansnell
mikevansnell / invite.js
Last active October 22, 2018 21:04
Parse.com cloudcode sample that enables one user to invite another user, and immediately returns the new user object so that you can do something with it (e.g. start associating objects with it).
// 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);
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);
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