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
Hull.data.api({ | |
provider: 'facebook', | |
path: 'me/friends' | |
}).then(function (data) { | |
console.log('Data from Facebook:', data); //should be like {data: Array, paging: Object} | |
}); |
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
Hull.init({ | |
appId: "XYZ", | |
orgUrl: "abc" | |
}).then(function (obj) { | |
console.log('Hull.js is initialized, you can starts doing API calls'); | |
// You can do API calls whether from the obj parameter or from the global object Hull (see below) | |
}, function (err) { | |
console.error('Ooops, something went wrong:', err); | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<!-- Insert you hull.io dashboard snippet here --> | |
</head> | |
<body></body> | |
</html> |
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
createLock = (locks, openDoorFn)-> | |
_locks = [].concat locks | |
(lock)-> | |
index = _locks.indexOf lock | |
openDoorFn() if !!~index and _locks.splice(index, 1).length and !_locks.length | |
unlock = createLock ['init', 'require'], -> alert("Unlocked") | |
unlock('abc') # ignored | |
unlock('bcd') # ignored |
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
var restify = require('restify'); | |
var client = restify.createJsonClient({ | |
url: 'https://YOUR_ORG_NAMESPACE.hullapp.io', | |
headers: { | |
'Hull-App-Id': 'YOUR_APP_ID', | |
'Hull-Access-Token': 'YOUR_APP_SECRET' | |
} | |
}); |
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
#install required packages | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y git curl build-essential libssl-dev libcurl4-openssl-dev nodejs | |
#install sqlite3 (optional) | |
apt-get install libsqlite3-dev sqlite3 | |
#install postgres (optional) | |
sudo apt-get install postlibpq-dev |
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
// | |
// This script shows how to add custom traits to a user | |
// | |
var hull = require('hull'); | |
hull.conf({ | |
appId: 'abcd', | |
orgUrl: 'https://demo.hullapp.io', | |
appSecret: '1234' |
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
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/Users/xav/code/karma-bro-proxyquireify/node_modules/proxyquireify/index.js":[function(require,module,exports){ | |
'use strict'; | |
function ProxyquireifyError(msg) { | |
this.name = 'ProxyquireifyError'; | |
Error.captureStackTrace(this, ProxyquireifyError); | |
this.message = msg || 'An error occurred inside proxyquireify.'; | |
} | |
function validateArguments(request, stubs) { |
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
set $front_port "9000"; | |
set $front_host "10.0.2.2"; | |
location @proxy_to_front { | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Protocol $scheme; | |
rewrite ^/app(.*) $1 break; |
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
#!/usr/bin/env sh | |
# | |
# You can change the version by passing the "VERSION" environment variable | |
# eg, env VERSION=0.10 sh node_nvm.sh | |
# | |
: ${VERSION:="stable"} | |
echo |