This file contains hidden or 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 kkeys = [], | |
konami = "38,38,40,40,37,39,37,39,66,65"; | |
easterEgg = function (e) { | |
kkeys.push(e.keyCode); | |
if (kkeys.toString().indexOf(konami) == 0) { | |
var ee = $('<div id="ee">TROLOLOL</div>'); | |
ee.css({ |
This file contains hidden or 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 hasFirebugLite = false; | |
runFirebug = function () { | |
if (!hasFirebugLite) { | |
$.getScript('https://getfirebug.com/firebug-lite.js', function () { | |
hasFirebugLite = true; | |
}); | |
} | |
} |
This file contains hidden or 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
//copiei do http://petelepage.com/presentations/2011/gdd-br/webapps/helpers/dnd-lib.js | |
function habilitarDragAndDrop(id, thumbsId) { | |
var el_ = document.getElementById(id); | |
var thumbnails_ = document.getElementById(thumbsId); | |
this.dragenter = function(e) { | |
e.stopPropagation(); | |
e.preventDefault(); | |
el_.classList.add('dropHere'); |
This file contains hidden or 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
jQuery.fn.extend({ | |
reset : function() { | |
return jQuery(this).filter('form').each(function() { | |
return this.reset(); | |
}).end(); | |
} | |
}); | |
$('form').bind('submit', function(e) { |
This file contains hidden or 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 revealingModulePattern = function() { | |
var privateVar = 1; | |
function privateFunction() { | |
alert('private'); | |
}; | |
var publicVar = 2; | |
function publicFunction() { |
This file contains hidden or 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
/* Inspirado no post: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth | |
Vantagens: | |
- Permitir a utilização de métodos/propriedades privadas. | |
- Adicionar metodos ou propriedades ao objeto ProjetoX a partir de outros arquivos js | |
Desvantagens: | |
- Como não é uma classe e em runtine eu não crio uma instância (new NAP()), | |
não é possível usar o this dentro de um método do objeto NAP | |
para invocar outro que também é método do objeto NAP. |
This file contains hidden or 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
/* Vantagens: | |
- Organizador de métodos e propriedades, permite ser estendido por outros arquivos js. | |
- Utilizar um 'namespace' favorece o melhor consumo de memória (nos antigos IE). | |
Desvantagens: | |
- Como não é uma classe e em runtine eu não crio uma instância (new NAP()), | |
não é possível usar o this dentro de um método do objeto NAP | |
para invocar outro que também é método do objeto NAP. | |
*/ |
This file contains hidden or 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 ($) { | |
$.extend({ //plugins without context. e.g: $.plugin(); | |
firebugLite: function () { | |
var vars = { | |
keys: [], | |
sequence: "68,69,66,85,71", | |
loaded: false, | |
serviceURL: 'https://getfirebug.com/firebug-lite.js' | |
}; |
This file contains hidden or 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
# PHP error handling for production servers | |
# disable display of startup errors | |
php_flag display_startup_errors off | |
# disable display of all other errors | |
php_flag display_errors off | |
# disable html markup of errors | |
php_flag html_errors off |
This file contains hidden or 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
//gerado pelo http://themergency.com/generators/cpt-code-output/?id=8966 | |
add_action( 'init', 'register_cpt_atividade' ); | |
function register_cpt_atividade() { | |
$labels = array( | |
'name' => _x( 'Atividades', 'atividade' ), | |
'singular_name' => _x( 'Atividade', 'atividade' ), | |
'add_new' => _x( 'Adicionar Atividade', 'atividade' ), |