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(){ | |
/** | |
* Twitter interaction | |
* @see https://dev.twitter.com/docs/tfw/events | |
*/ | |
var category = 'social', | |
action = 'twitter'; | |
if(twttr && twttr.events && twttr.events.bind){ | |
twttr.events.bind('tweet', function (event) { |
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 Constructor_name = (function(){ | |
/** CONSTRUCTOR **/ | |
function Constructor_name (params) { | |
// body... | |
} | |
/** PRIVATE METHODS **/ |
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 http = require('http'), | |
fs = require('fs'), | |
htmlPath = './html', | |
server = http.createServer(function(req, res){ | |
var pagina = req.url == '/' ? '/index' : req.url; | |
pagina = htmlPath + pagina + '.html'; | |
fs.exists(pagina, function(exists) { | |
if (!exists) pagina = htmlPath + '/404.html'; | |
fs.readFile(pagina, function(err, html){ | |
if (err) { |
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 linker; | |
var myLink = document.getElementById('link1'); // Add event listeners to link. | |
addListener(myLink, 'mousedown', decorateMe); | |
addListener(myLink, 'keydown', decorateMe); | |
function decorateMe(event) { | |
event = event || window.event; // Cross browser hoops. | |
var target = event.target || event.srcElement; |
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
FB.Event.subscribe('edge.create', function (url, element) { | |
console.log(['like', url, element]); | |
}); | |
FB.Event.subscribe('edge.remove', function (url, element) { | |
console.log(['unlike', url, element]); | |
}); |
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 hasAnalyticsGoogle(){ | |
var scripts = document.getElementsByTagName('script'), | |
ga = true, ua = true, dc = false, | |
i, len, s; | |
len = scripts.length; | |
if (ga || ua || dc) { | |
for (i = 0; i < len; i += 1) { | |
s = scripts[i].src; |
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
/** | |
* @fileoverview Manage Cross-Domain Tracking | |
* @author Marcus Ortense | |
* @see http://lucida-brasil.github.io/clientes/bluehive/ford-crossdomain.html | |
*/ | |
/** | |
* url_decorate | |
* @global | |
* @param {string} 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
"use strict"; | |
/* <3 ES6 */ | |
class People{ | |
constructor(name, birthday){ | |
this.name = name; | |
this.birthday = birthday || new Date(); | |
} | |
sayName() { |
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
{ | |
"funcionarios" : [ | |
{"id":1, "nome":"Ortense", "cargo": "JS Developer", "id_empresa": 1}, | |
{"id":2, "nome":"Toschi", "cargo": "JS Developer", "id_empresa": 1}, | |
{"id":3, "nome":"Gafanhoto", "cargo": "JS Developer", "id_empresa": 1} | |
], | |
"empresas" : [ | |
{"id" : 1, "nome" : "Lúcida"}, | |
{"id" : 2, "nome" : "ACME"} | |
] |
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
/* | |
Componente ES6 baseado na serie do Vedovelli sobre Vue.js | |
http://vuejs.org/ | |
http://www.vedcasts.com.br/series/vuejs | |
ultima aula assistida: http://www.vedcasts.com.br/series/vuejs/aula9 | |
*/ | |
"use strict"; | |
Vue.filter('dataFormat', (value, formatString = 'DD/MM/YYYY') => { |