Skip to content

Instantly share code, notes, and snippets.

View stephanelpaul's full-sized avatar
🌍

Stephane Leandre Paul stephanelpaul

🌍
View GitHub Profile
@brly
brly / gist:37c44f51a7908730c161
Created June 22, 2014 17:46
martini json response sample
package main
import (
"github.com/go-martini/martini"
"github.com/martini-contrib/render"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"net/http"
)
@lantins
lantins / main.go
Last active August 29, 2015 14:12
Golang - HTTP Server - Contexts
package main
import (
"fmt"
"github.com/julienschmidt/httprouter"
"log"
"net/http"
"os"
"strconv"
)
@thgbarros
thgbarros / models.js
Last active April 23, 2019 07:24
OAuth 2.0 server implementation to Alexa Skill Account linking
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) {