Skip to content

Instantly share code, notes, and snippets.

View esperancaJS's full-sized avatar
💭
investigating Deep Learning

Pedro Esperança esperancaJS

💭
investigating Deep Learning
View GitHub Profile
this.FbLogin = function(){
FB.login(function(response) {
console.log('login response');
console.log(response);
if(response.status === 'connected'){
FB.api('/me/permissions', function(response) {
console.log(response);
if(response.data[1].status !== 'granted'){ //email
retryToLogin();
}
{
"currency_id": "56fea972e602590003000015",
"venue_id": "5720b8772bd1210003000002",
"hashtags": [
"gourmet",
"casual",
"relaxed",
"conversation",
"extravagant"
],
ok o evento ta criado
57351b742725550003000018
é o id
a imagem do user: http://res.cloudinary.com/altar/image/upload/v1463098420/zbF3wWJk_njztfo.png
muda a data do evento para q fique em 3º (talvez tenhas q mudar as datas de mais eventos)
troca a venue por esta: 56fea973e602590003000025
alguma coisa liga-me para o 936191904 que por aqui sou capaz d n responder
Error: Cannot call AccessToken.findById(). The findById method has not been setup. The PersistedModel has not been correctly attached to a DataSource!
at throwNotAttached (C:\Users\pedro.esperanca\Documents\connect.wtf\api\node_modules\loopback\lib\persisted-model.js:67:11)
at Function.find [as findById] (C:\Users\pedro.esperanca\Documents\connect.wtf\api\node_modules\loopback\lib\persisted-model.js:184:5)
at Function.AccessToken.findForRequest (C:\Users\pedro.esperanca\Documents\connect.wtf\api\node_modules\loopback\common\models\access-token.js:105:12)
at C:\Users\pedro.esperanca\Documents\connect.wtf\api\node_modules\loopback\server\middleware\token.js:124:16
at C:\Users\pedro.esperanca\Documents\connect.wtf\api\node_modules\loopback\server\middleware\rest.js:77:7
at iterate (C:\Users\pedro.esperanca\Documents\connect.wtf\api\node_modules\loopback\node_modules\async\lib\async.js:146:13)
at C:\Users\pedro.esperanca\Documents\connect.wtf\api\node_modules\loopback\node_modules\asyn
@esperancaJS
esperancaJS / gist:ec818ea9fa82e717a5897fe1cc9c8d15
Created August 7, 2016 22:31
NumberSolitaire Javascript Codility 100%
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A) {
var d = 6;
var n = A.length;
maxScore = [];
//for 0
for (var i = 0; i < d; i++){
@esperancaJS
esperancaJS / TieRopes Codility Javascript 100%
Last active August 20, 2016 17:03
TieRopes Codility Javascript 100%
function solution(K, A) {
var possibleRopesCount = 0;
var fromPrev = 0;
for (var i = 0; i<A.length; i++){
if((fromPrev + A[i]) >= K){
possibleRopesCount++;
fromPrev = 0;
} else {
function solution(A) {
//other shore bank
A.push(1);
//array with shortest paths for each leaf/bank
var reachable = [];
for(var i = 0; i<A.length; i++){
reachable.push(-1);
}
ERROR in ENOENT: no such file or directory, scandir 'C:\Users\pedro.esperanca\Documents\connect.wtf\web\node_modules\node-sass\vendor'
@ ./~/style-loader!./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/source-map-loader!./~/bootstrap-loader/no-op.js 4:14-257
ERROR in ENOENT: no such file or directory, scandir 'C:\Users\pedro.esperanca\Documents\connect.wtf\web\node_modules\node-sass\vendor'
@ ./src/app/components/app.component.ts 79:21-48
ERROR in ENOENT: no such file or directory, scandir 'C:\Users\pedro.esperanca\Documents\connect.wtf\web\node_modules\node-sass\vendor'
@ ./~/awesome-typescript-loader/dist.babel/entry.js!./~/angular2-template-loader!./src/app/components/index/index.component.ts 18:21-50
ERROR in ENOENT: no such file or directory, scandir 'C:\Users\pedro.esperanca\Documents\connect.wtf\web\node_modules\node-sass\vendor'
import angular from 'angular';
import Home from './home/home';
import About from './about/about';
import Pokemonlist from './pokemonlist/pokemonlist';
let componentModule = angular.module('app.components', [
Home,
About,
Pokemonlist
])
@esperancaJS
esperancaJS / issues.md
Last active September 26, 2016 08:14
Angular 3 dev environment setup issues

(all repositories are in branch pre-master)

Clicking login with the correct credentials returns in the console:

angular.js:11442 POST http://localhost:9000/api/authenticate net::ERR_EMPTY_RESPONSE(anonymous function) @ angular.js:11442sendReq @ angular.js:11235serverRequest @ angular.js:10945processQueue @ angular.js:15552(anonymous function) @ angular.js:15568$eval @ angular.js:16820$digest @ angular.js:16636$apply @ angular.js:16928(anonymous function) @ angular.js:24551dispatch @ jquery.js:4435elemData.handle @ jquery.js:4121
login.js:33 null
angular.js:13236 Error sent to server
angular.js:13236 TypeError: Cannot read property 'message' of null
    at http://localhost:9000/components/login/controllers/login.js:34:37