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
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
<!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
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
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
<?php | |
require 'vendor/autoload.php'; | |
$hull = new Hull_Client(array( 'hull' => array( | |
'host' => 'YOUR_ORG_URL', | |
'appId' => 'YOUR_APP_ID', | |
'appSecret' => 'YOUR_APP_SECRET' | |
))); | |
$app = $hull->get('app'); | |
var_dump($app); |
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
# | |
# Usage: | |
# ghp BUILD_DIR GIT_REPO_URL | |
# | |
function ghp () { | |
cd $0 | |
git init | |
git add -A | |
git remote add origin $1 | |
git commit -m "Generated at $(date)" |
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 clouseau = require('clouseau-js'); | |
function alertCheck(page) { | |
var dfd = this; // `this` is a deferred! \o/ | |
page.onAlert = function (txt) { | |
if (txt !== 'MY EXPECTED MESSAGE') { | |
return dfd.reject(new Error("Unexpected message: " + txt)); | |
} | |
return dfd.resolve(page); | |
}; |
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
Copyright (c) 2015 - Xavier Cambar <@ xcambar_gmail.com> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |
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
Module ModernizrLoader { | |
import * from "./modernizr.min.js" | |
export Modernizr | |
} |