This file contains 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
<html> | |
<script type="text/javascript"> | |
// https://developers.google.com/url-shortener/v1/getting_started | |
// | |
function load() { | |
// get your keys from here https://developers.google.com/url-shortener/v1/getting_started#APIKey | |
gapi.client.setApiKey('XXX-YOUR-KEY-GOES-HERE-XXXX'); |
This file contains 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
<script src="https://www.gstatic.com/firebasejs/4.1.3/firebase.js"></script> | |
<script> | |
// Initialize Firebase | |
var config = { | |
// YOUR CONFIG goes here - https://firebase.google.com/docs/web/setup#add_firebase_to_your_app | |
}; | |
var firebaseApp = firebase.initializeApp(config); | |
var rootRef = firebase.database().ref(); | |
// Get a reference to the /users/ada node | |
var adaRef = firebase.database().ref("users/ada"); |
This file contains 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
<script src="http://cdn.peerjs.com/0.3/peer.min.js"></script> | |
<script type="text/javascript"> | |
// https://github.com/peers/peerjs | |
// go here to get your own key | |
var peerjsPeer = new Peer({key: 'xxxYOURKEYGOESHERExxxx'}); | |
peerjsPeer.on('open', function() { | |
console.log('My peerjsPeer ID is: ', peerjsPeer.id); | |
}); |
This file contains 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
self.addEventListener('message', function(event) { | |
console.log('in worker - received event', event) | |
self.postMessage('started') | |
}, false); |
This file contains 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
<!-- Augmented Reality on the Web in 10 lines of html! https://github.com/jeromeetienne/ar.js --> | |
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script> | |
<script src="../build/aframe-ar.min.js"></script> | |
<body style='margin : 0px; overflow: hidden;'> | |
<a-scene embedded arjs='sourceType: webcam;'> | |
<a-box position='0 0.5 0' material='opacity: 0.5;'></a-box> | |
<a-marker-camera preset='hiro'></a-marker-camera> | |
</a-scene> | |
</body> |
This file contains 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
license: mit |
This file contains 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
<script src='https://cdn.rawgit.com/jeromeetienne/startupthree.js/0.6.0/startupThree.js'></script> |
This file contains 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
// source testbed.js | |
/** | |
* A description | |
* @returns {Number} - a number | |
*/ | |
function foo() { | |
return 2 | |
} | |
// SOURCE generated by transform-jsdoc |
This file contains 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
# to add the git branch in the prompt | |
__git_ps1(){ | |
local b="$(git symbolic-ref HEAD 2>/dev/null)"; | |
if [ -n "$b" ]; then | |
printf "(%s)" "${b##refs/heads/}"; | |
fi | |
} | |
export PS1='\u@\h:\w$(__git_ps1 " (%s)")\$ ' |
This file contains 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 data = { | |
foobar : 1234.56789 // NOTE: see the number | |
} | |
data = JSON.parse(JSON.stringify(data, function(key, value){ | |
if( typeof(value) !== 'number' ) return value; | |
// for number, keep at most 6 digits after dot | |
return Number( value.toFixed(6) ) | |
})) |
NewerOlder