Skip to content

Instantly share code, notes, and snippets.

View notsuhz's full-sized avatar

Suhaimi notsuhz

View GitHub Profile
[
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Åland Islands",
"code": "AX"
},
{
@notsuhz
notsuhz / jsonp.js
Created January 3, 2019 08:17 — forked from gf3/jsonp.js
Simple JSONP in vanilla JS
/**
* loadJSONP( url, hollaback [, context] ) -> Null
* - url (String): URL to data resource.
* - hollaback (Function): Function to call when data is successfully loaded,
* it receives one argument: the data.
* - context (Object): Context to invoke the hollaback function in.
*
* Load external data through a JSONP interface.
*
* ### Examples
How to exchange social media token to md-auth. Might be useful for authentication on mobile apps
# API
`/external/exchangeToken/{socialNetworkName}?companyId={companyId}&id={userId}&token={userToken}&sessionId={sessionId}`
## GET
- *companyId* : 59780722102c881694558c94 (matdespatch.com default)
- *userId* : id from social network
- *userToken* : token from social network
- *sessionId* (optional) : sessionId obtained after exchangingToken, useful to persist current session

Keybase proof

I hereby claim:

  • I am suhz on github.
  • I am suhz (https://keybase.io/suhz) on keybase.
  • I have a public key whose fingerprint is 78C3 FDCF D72C 6BD9 E066 EB8F CB9D 59B9 81A9 EAD7

To claim this, I am signing this object: