Skip to content

Instantly share code, notes, and snippets.

View thaniaclair's full-sized avatar

Thania Vargas Billet thaniaclair

View GitHub Profile
public int getMinimumSeats() {
String minSeats = SystemConfiguration.get().getParam(Group.ServiceRenfe, "minSeats");
if (Strings.isNullOrEmpty(minSeats)) {
return DEFAULT_MINIMUM_SEATS_TO_FILTER;
}
return Ints.tryParse(minSeats);
}
public boolean isTariffApproved() {
//-- Empty availability => REJECT
@thaniaclair
thaniaclair / RenfeAvailability.java
Created December 7, 2015 17:09
Renfe Logic for Availability
public boolean isTariffApproved() {
String currentTariffAvailability = tarifa.getDisponibilidad();
if (Strings.isNullOrEmpty(currentTariffAvailability)) {
return false;
}
if (HIGH_AVAILABILITY.equals(currentTariffAvailability)) {
return true;
}
@thaniaclair
thaniaclair / AddColumnUnlessExists
Created July 17, 2013 15:34
AddColumnUnlessExists
drop procedure if exists AddColumnUnlessExists;
delimiter '//'
create procedure AddColumnUnlessExists(
IN dbName tinytext,
IN tableName tinytext,
IN ddl text)
begin
IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
WHERE column_name=fieldName
@thaniaclair
thaniaclair / grant.sql
Created June 5, 2013 17:50
Ajustes Virada
CREATE USER 'knowtec' IDENTIFIED BY 'RI9n5Tpv3gUCDC';
FLUSH PRIVILEGES;
DROP USER 'knowtec'@'localhost';
GRANT ALL ON GLOBAL_SI TO 'knowtec'@'%' IDENTIFIED BY 'RI9n5Tpv3gUCDC';
Select *
from mysql.user
where user = 'knowtec';
@thaniaclair
thaniaclair / procedure_templates.sql
Created June 5, 2013 17:15
Procedure para templates de clientes
-- *****************************************************************************
-- PLATAFORMAIC-READER
-- Insercao de templates para formularios e feedbacks
-- *****************************************************************************
DECLARE
type ClienteArray is varray(1) of NUMBER(10,0);
type TemplateArray is varray(8) of VARCHAR2(100);
clientes ClienteArray;
@thaniaclair
thaniaclair / impexp
Last active December 17, 2015 15:19
Import / Export dump Oracle
exp system/prolha24@xe file=/backup/oracle_NOVOSIS_DSV.dmp owner=NOVOSIS_DSV
imp system/admin@home FROMUSER=NOVOSIS_DSV TOUSER=NOVOSIS_DSV file=E:\tmp\oracle.dmp full=no log=e:\tmp\imp_log.log
import java.io.IOException;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
@thaniaclair
thaniaclair / feed.js
Created May 18, 2013 19:32
Using Facebook Graph API
/**
* Efetua operações relacionadas ao feed de notícias do SIS na rede social Facebook.
*/
var feed = {
/**
* Inicializa os eventos relacionados ao Facebook.
*/
init: function() {
page.loadAccessToken();
@thaniaclair
thaniaclair / gerenciador-arvore.js
Created May 11, 2013 20:27
Gerenciador de árvore JS.
/**
* Gerencia os eventos para criação e atualização de tópicos e temas.
* @author Thania
*/
var gerenciadorArvore = {
/**
* Instala os eventos necessários após o carregamento total da página.
*/
init: function() {
@thaniaclair
thaniaclair / last-tweet.js
Created May 11, 2013 20:27
Recupera o último tweet JS.
var lastTweet = {
init: function() {
lastTweet.show();
},
getAbsolutePath: function() {
return $("meta[name='path']").attr("content");
},
show: function() {
var params = { "nomeUsuarioTwitter" : "sebrae_sc_sis" };
var url = lastTweet.getAbsolutePath() + "ajax/getLastTweet";