Skip to content

Instantly share code, notes, and snippets.

View desireesantos's full-sized avatar

Desiree Santos desireesantos

View GitHub Profile
var pessoa = function (nome, sobrenome) {
var obj = {};
obj.getNome = function () {
return nome;
};
obj.getSobrenome = function () {
return sobrenome;
@desireesantos
desireesantos / SpecRunner.html
Created December 8, 2012 19:25
SpecRunner.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.0/jasmine.css">
<script type="text/javascript" src="lib/jasmine-1.3.0/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.3.0/jasmine-html.js"></script>
@desireesantos
desireesantos / SpecRunner.html
Created December 9, 2012 11:23
SpecRunner has new path source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.0/jasmine.css">
<script type="text/javascript" src="lib/jasmine-1.3.0/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.3.0/jasmine-html.js"></script>
@desireesantos
desireesantos / LinePosition
Last active December 11, 2015 00:49
Controlar a posição da coordenada x,y
var LinePositionControl = function (word, position) {
var YPosition = 180;
var marginRight = 980;
var coordinateXPosition = position;
this.currentPositionX = function () {
@desireesantos
desireesantos / gist:4958164
Last active December 13, 2015 18:49
Gerar relatório com JSF 2.0 + primefaces: DataExporter
<p:dataTable id="questionario" var="perg"
value="#{perguntas.listarCadastrarPerguntas}" paginator="true" rows="10"
emptyMessage="Nenhuma pergunta cadastrada.">
<p:column exportable="false">
<f:facet name="output">
<h:outputText value="Pergunta" />
</f:facet>
<h:outputText value="#{perg.value}" />
</p:column>
@desireesantos
desireesantos / Hotel.java
Last active December 14, 2015 05:29
Java Code
package com.hotel;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author desireeSantos
*
*/
public class Hotel {
@desireesantos
desireesantos / SendFileInMail.java
Created August 8, 2013 17:12
HtmlEmail - Criar email com arquivo anexado
package com.trailblazers.freewheelers.model;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail;
import static com.trailblazers.freewheelers.model.SetupMail.*;
public class SendFileInMail {
@desireesantos
desireesantos / PdfFactoryTest.java
Created August 11, 2013 13:04
PdfFactoryTest
package com.trailblazers.freewheelers.model;
import com.itextpdf.text.Document;
import static org.mockito.Mockito.verify;
import com.itextpdf.text.pdf.PdfWriter;
import org.junit.Test;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
package com.trailblazers.freewheelers.model;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
@desireesantos
desireesantos / HelloWord.class
Last active December 31, 2015 09:18
Using Configuration.class to set a personal folder struct to put .html files (In the end of class there is a struct of folder, that you can follow or create yours.)
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import spark.Request;
import spark.Response;
import spark.Route;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;