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
/** | |
* underplate it's just the template lib used by underscore lib. I just | |
* removed all underscore code to can use just the good template engine. | |
* | |
* All code here was writed by underscore team. | |
* | |
* Based at Underscore.js 1.5.2 | |
* | |
* @licence The MIT License (MIT) | |
*/ |
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
/** | |
* Simples Lib de template para substituir apenas variáveis. Útil para montar URL | |
* de Webservices com parâmetros variáveis. | |
* | |
* @param {String} template | |
* @param {Json} obj Objetos que serão adicionados no template | |
* @returns {String} | |
*/ | |
function maker(template, obj) { | |
var attr; |
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 page = require('webpage').create(), | |
system = require('system'); | |
page.viewportSize = { width: 1024, height: 768 }; | |
if(system.args.length < 2) { | |
console.log("Informe a URL para realizar o prinscreen."); | |
console.log("phantomjs http://www.uol.com.br/"); | |
phantom.exit(1); | |
} |
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
<?php | |
/** | |
* Created on 06/Jan/2010 | |
* | |
* Classe com métodos encadeados para criar | |
* ou ler arquivos. | |
* | |
* @author Gustavo Paes (http://gustavopaes.net/) | |
* @version 1.0124.01 | |
**/ |
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
/** | |
* Valida se o usuário está habilitado para usar a API localStorage. | |
* https://gist.github.com/gustavopaes/6024904 | |
* @type {Boolean} | |
*/ | |
var storageValidation = (function(window) { | |
'use strict'; | |
var validation; | |
try { | |
// IE <= 9 e demais navegadores devem retornar TRUE |
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() { | |
var testInput = document.createElement('input'); | |
if('placeholder' in testInput || 'placeHolder' in testInput) { | |
return false; | |
} | |
var inputs = document.querySelectorAll('input'); | |
for(var i = 0, m = inputs.length; i < m; i++) { | |
var input = inputs[i]; | |
var inputPlaceholder = input.getAttribute('placeholder'); |
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
oldFunction = (function(temp) { | |
return function() { | |
if(typeof temp != 'undefined') | |
temp(); | |
// your new code here | |
... | |
} | |
})(oldFunction); |
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(time) { | |
function again() { | |
var procede = yourActionFunction(); | |
if(procede) | |
setTimeout(again, time); | |
} | |
again(time); | |
})(5000); |
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
find ./ -name "*.php" -print0 | xargs -0 grep "my query string" >> found.txt |
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
#!/bin/sh | |
while [ 1 ]; | |
do | |
/usr/local/bin/php /your/path/to/cron.php >> log-exec.log | |
sleep 1800 | |
done |
NewerOlder