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 R = require("request"); | |
var key = process.env.TWITTER_CONSUMER_KEY; | |
var secret = process.env.TWITTER_CONSUMER_SECRET; | |
var cat = key +":"+secret; | |
var credentials = new Buffer(cat).toString('base64'); | |
var url = 'https://api.twitter.com/oauth2/token'; | |
R({ url: url, |
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 request = require('request'); | |
var consumer_key = 'YOUR_CONSUMER_KEY'; | |
var consumer_secret = 'YOUR_CONSUMER_SECRET'; | |
var enc_secret = new Buffer(consumer_key + ':' + consumer_secret).toString('base64'); | |
var oauthOptions = { | |
url: 'https://api.twitter.com/oauth2/token', | |
headers: {'Authorization': 'Basic ' + enc_secret, 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, | |
body: 'grant_type=client_credentials' | |
}; |
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
CustomInfoWindow.prototype.panMap = function(marker, map) { | |
var offsetX = 100 | |
var offsetY = 75 | |
var scale = Math.pow(2,map.getZoom()) | |
var center = map.getProjection().fromLatLngToPoint(marker.getPosition()) | |
var newCenterPoint = new google.maps.Point( | |
center.x - offsetX/scale, | |
center.y + offsetY/scale | |
) | |
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
function go() { | |
var userId = prompt('Username?', 'Guest'); | |
checkIfUserExists(userId); | |
} | |
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users'; | |
function userExistsCallback(userId, exists) { | |
if (exists) { | |
alert('user ' + userId + ' exists!'); |
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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder