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
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../paper-item/paper-item.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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 isObjectEmpty(obj) { | |
return Object.keys(obj).length === 0; | |
} | |
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
/* | |
the trick is in function.bind(null, args ...) | |
The functions will be executed independently but the results will be returned all togheter | |
in the array in the same order the functions were called | |
*/ | |
var async = require("async"); | |
function fn1(paramA, paramB, paramC, callback) { | |
setTimeout(function(){ | |
var ret = '(' + paramA + ' ' + paramB + ' ' + paramC + ')'; |
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
/* | |
With async.waterfall the functions are executed one after the other and the result of each one is used | |
to call the next function. | |
fn0 -> fn1(resultFromfn0, callback) -> fn2(resultFromfn1, callback) -> fn3(resultFromfn2, callback) | |
*/ | |
var async = require("async"); | |
function fn0(myParam, callback) { | |
setTimeout(function(){ | |
if (myParam === "ciao") { |
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
/* | |
the example find data from facebook api search endpoint | |
*/ | |
var findPages = function($center, $limit, $offset, callback) { | |
FB.api("/search", {q: "", type: "place", center: $center, distance: "15000", limit: $limit, offset: $offset, access_token: access_token}, function(result) { | |
callback(result); | |
}); | |
}; |
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
How to get a Facebook Page Access Token that doesn't expire Never! | |
- Go to http://developers.facebook.com/tools/explorer/ | |
- Get a User Access Token with a permission "manage_pages" | |
- Convert this short-lived access token into a long-lived one by making this Graph API call: | |
https://graph.facebook.com/v2.6/oauth/access_token?client_id=<your FB App ID >&client_secret=<your FB App secret>&grant_type=fb_exchange_token&fb_exchange_token=<your short-lived access token> | |
- Make a call Graph API: | |
https://graph.facebook.com/v2.6/<your personal account FB user id>/accounts?access_token=<your long-lived access token> | |
- The returned access_token has no expiration unless you change your password or not more admin of the target page or deauthorize FB page |
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
http://stackoverflow.com/questions/84847/how-do-i-create-a-self-signed-certificate-for-code-signing-on-windows |
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
Professional SP2 VOL CCMWP-99T99-KCY96-FGKBW-F9WJT |
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
////////////////// from angular to jquery | |
// in angular controller | |
$scope.execFn1 = function() { | |
document.dispatchEvent(new CustomEvent( 'testEvent1', | |
{ | |
detail: {mydata1: 'hello from angular'} | |
} | |
) | |
); |
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 sqlite3 = require("sqlite3").verbose(); | |
var db = new sqlite3.Database('database/pagine.sqlite3'); | |
var async = require("async"); | |
var deasync = require("deasync"); | |
var mysql = require('mysql'); | |
var connection = mysql.createConnection({ | |
host : 'localhost', |
OlderNewer