Skip to content

Instantly share code, notes, and snippets.

Avatar

Dennys dennysfredericci

View GitHub Profile
View ApplicationHelper.rb
module ApplicationHelper
def teste
#profile_url = Net::HTTP.get_response(URI.parse("http://graph.facebook.com/#{100000335750045}/picture?type=large"))['location']
#second_image = Net::HTTP.get_response(URI.parse("https://taylorgraceauthor.files.wordpress.com/2015/11/6917465-french-flag-wallpaper.jpg"))['location']
#Deve ter transparencia
first = "#{Rails.public_path}/mask.png"
@dennysfredericci
dennysfredericci / TibcoSender.java
Created Oct 16, 2014
Tibco Rendezvous Sender Sample
View TibcoSender.java
package br.com.fredericci.test;
import com.tibco.tibrv.Tibrv;
import com.tibco.tibrv.TibrvMsg;
import com.tibco.tibrv.TibrvRvdTransport;
public class TibcoSender
{
public static void main(String[] args) throws Exception
@dennysfredericci
dennysfredericci / validator
Created Jul 2, 2012
An easy way to use JQuery Validation with Twitter Bootstrap Popover
View validator
$('form').validate(
{
rules: {
numero: {
required: true
},
descricao: {
minlength: 3,
email: true,
required: true
@dennysfredericci
dennysfredericci / find.sh
Created Jul 9, 2018
Find class in jar fiels
View find.sh
find ./ -name "*.jar" | xargs grep org/springframework/data/mapping/context/MappingContext.class
@dennysfredericci
dennysfredericci / gist:890c5d76e84de91d52a9f88df0965588
Created Aug 17, 2018
Add Twitter Bootstrap at Angular Project
View gist:890c5d76e84de91d52a9f88df0965588
1. Create angular project
ng new my-app
2. Install bootstrap dependencies
npm install --save @ng-bootstrap/ng-bootstrap bootstrap@4.1.3 font-awesome
3. Add the lines below in scripts array at angular.json
View LiquibaseGeneratorForFormulierOnderdeel.java
package be.schaubroeck.golf.liquibase.corrections;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.text.StrSubstitutor;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
@dennysfredericci
dennysfredericci / DemoApplication.java
Last active Nov 15, 2019
Example of Spring Bean in a Request Scope
View DemoApplication.java
package com.example.demo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
View GenderConverter.java
@Converter(autoApply = true)
public class GenderConverter implements AttributeConverter<Gender, String> {
@Override
public String convertToDatabaseColumn(Gender gender) {
return gender.getCode();
}
@Override
public Gender convertToEntityAttribute(String code) {
View Person.java
@Entity
public class Person {
@Id
private Long id;
private String firstName;
private String lastName;
@Enumerated(EnumType.STRING)
private Gender gender;
View Gender.java
public enum Gender {
FEMALE,
MALE,
NOT_AVAILABLE;
}