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
<html> | |
<body> | |
<form method="post" action="centro.php" enctype="multipart/form-data"> | |
<input type="hidden" name="acao" value="upload-logo"> | |
<input type="file" name="logo"> | |
<input type="submit" value="Enviar"> | |
</form> | |
</body> | |
</html> |
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
public void exportReportToPdfStream(List<JasperPrint> prints, OutputStream output) throws JRException | |
{ | |
JRPdfExporter exporter = new JRPdfExporter(); | |
exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, prints); | |
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, output); | |
exporter.exportReport(); | |
} |
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
import java.io.BufferedInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.math.BigInteger; | |
import java.security.MessageDigest; | |
public class Util | |
{ | |
public static String md5File(File file) throws Exception | |
{ |
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/bash | |
# Torna agradavel a chamada ao YUI na linha de comando | |
# yui by Andre Souza (andre.souza@gmail.com) | |
# | |
# modo de uso: yui --type js input.js -o output.js | |
java -jar /path/to/yui-compressor.jar $* |
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 | |
$action = $_REQUEST["acao"]; | |
if($action=="upload-logo") | |
{ | |
processaLogo(); | |
} | |
?> |
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 | |
function processaLogo() | |
{ | |
$logo = processaUploadLogo($_FILES["logo"]); | |
if(!$logo) | |
{ | |
header("location: index.php?retorno=upload-invalido"); | |
return; | |
} |
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 | |
read -p "usuario: " usuario; | |
read -p "senha: " senha; | |
read -p "link: " download; | |
nomeArquivo=`echo $download | awk 'BEGIN{FS="/"}{print $NF }'`; | |
authLink="https://profile.oracle.com/jsp/reg/loginHandler.jsp"; | |
if [ -z $usuario ] || [ -z $senha ] |
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
public class BitlyJExample | |
{ | |
public static void main(String[] args) | |
{ | |
Bitly bitly = BitlyFactory.newInstance("<seu-login>", "<sua-chave>"); | |
BitlyUrl bUrl = bitly.shorten("http://rosaloves.com/stories/view/13"); | |
URL url = bitly.expandHash("hopetransfusion"); | |
BitlyUrlInfo info = bitly.info("hopetransfusion"); | |
} | |
} |
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
[Bindable] | |
protected var moduleInfo: IModuleInfo; | |
protected function menuClick(event:MenuEvent):void | |
{ | |
var className:String = event.item.@data; | |
var executa:Function = function():void | |
{ | |
var definition:Class = Class(getDefinitionByName(className)); |
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
public static function carregaCombo(combo:DropDownList, funcao:Function, currentSelected:*=null, callback:Function=null):void | |
{ | |
funcao.apply(null, [function(event:ResultEvent):void { | |
combo.dataProvider = event.result as ArrayCollection; | |
if(currentSelected) | |
selecionaCorrente(false, combo, currentSelected); | |
if(callback!=null) | |
callback.apply(null, [event]); |