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
| /* | |
| * To change this template, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| package servlet; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import java.util.Date; | |
| import javax.servlet.ServletConfig; |
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
| </head> | |
| <body> | |
| <div>Preencha os dados abaixo</div> | |
| <form name="formulario" action="oracularServlet" method="POST"> | |
| Nome<input type="text" name="nome"><br> | |
| Ano<input type="text" name="ano"><br> | |
| <input type="submit" name="Submit" value="Enviar"> | |
| </form> |
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
| //Colocar dentro do while have post | |
| <?php | |
| $size = 'thumbnail'; | |
| $attachments = get_children( array('post_parent' => get_the_ID(), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC',$ | |
| foreach ( $attachments as $thumb_id => $attachment ){ | |
| ?> | |
| <?php echo wp_get_attachment_image($thumb_id,$size); | |
| break; // meu ultimo post imprimia mais de uma imagem, ai coloquei break para garantir que iria parar o 'foreach' imprimindo só a 1ª foto |
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
| # Estou replicando uma foto , e estou usando paperclip. No caso do meu problema crio uma registro e quero utilizar a mesma | |
| # imagem para outros registros. | |
| def filepath(id, file, id_old) | |
| path="#{Rails.root}/public/system/foto/#{id}" | |
| unless File.exists?(path) | |
| FileUtils.mkdir(path) | |
| end | |
| FileUtils.cp Dir.glob("#{Rails.root}/public/system/foto/#{id_old}/*"), path | |
| files = Dir.entries(path) |
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
| # Olá pessoal, essa semana tive apanhando com a gem do pagseguro oficial, estive tentando utilizar os metodos: | |
| transaction = PagSeguro::Transaction.find_by_notification_code(params[:notificationCode]) #tras informações transação perlo código | |
| #e o retorno de dados automatico, que descobri q não funciona para a nova versão da gem. | |
| #SOLUÇÃO | |
| #===> Para o problema de encontrar a transação pelo codigo |
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
| $ rails _3.2.13_ new blog -d mysql |