How to get the xs value from Facebook cookie with Google Chrome:
- Open www.messenger.com
- Open Developer Tools
- Click "Application" tab
- Click, "Cookies" in the left panel
- Click "www.messenger.com"
- Copy the value of "xs"
Word of warning
// Extended answer: http://stackoverflow.com/questions/11873570/angularjs-for-loop-with-numbers-ranges/17124017#17124017 | |
// By caching the function result, it can become orders of magnitudes more efficient (depending on how big the range is) | |
// jsPerf: http://jsperf.com/memoizer-range/9 | |
$scope.range = (function() { | |
var cache = {}; | |
return function(min, max, step) { | |
var isCacheUseful = (max - min) > 70; | |
var cacheKey; |
var getTime = (function() { | |
var start = new Date().getTime(); | |
return function () { | |
var end = new Date().getTime(); | |
var time = end - start; | |
return time; | |
}; | |
})(); |
var request = require('request-promise'); | |
var crypto = require('crypto'); | |
var config = {...}; | |
function getAccessToken(cookies) { | |
var cookieName = 'fbsr_' + config.client_id; | |
var signedRequest = cookies[cookieName]; | |
var code = getCode(signedRequest); | |
return exchangeCodeForAccessToken(code); | |
}; |
Choose either option A or option B.
Facebook App Id: 435522656639081
Update: Facebook has closed the app above, and you must setup your own Facebook app. Follow the instructions in option B below.
Use this options, if you want to run the service from any other domain than localhost
pascalTriangle(10); | |
function pascalTriangle(levels) { | |
return _.reduce(_.range(levels), function(triangle, i) { | |
var row = _.reduce(_.range(i + 1), function(row, j) { | |
var isFirst = j === 0; | |
var isLast = j === i; | |
if (isFirst || isLast) { | |
row.push(1); | |
} else { |
var Q = require('q'); | |
function batchPromises(items, fn, options) { | |
var results = []; | |
var index = (options.batchSize - 1); | |
function getNextItem() { | |
index++; | |
if (items.length > index) { | |
var nextItem = items[index]; |
// npm install http-proxy | |
var httpProxy = require('http-proxy'); | |
var targetHost = '192.168.99.100'; | |
var port = 8489; | |
httpProxy.createProxyServer({target:'http://' + targetHost + ':' + port}).listen(port); |
``` | |
git reset --hard origin/master@{1} | |
``` |
Install packages
yarn add eslint prettier eslint-{config,plugin}-prettier eslint-plugin-react --dev --exact
package.json
{
"scripts": {