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
using NHibernate.Driver; | |
using NHibernate.Mapping.ByCode; | |
using NHibernate.Mapping.ByCode.Conformist; | |
namespace workshop_Entity | |
{ | |
public class Category | |
{ | |
public virtual int IdCategoria { get; set; } | |
public virtual string Nome { get; set; } |
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
For<IRepository<TipoServico>>().Use<Repository<TipoServico>>(); |
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
package com.bemobi.wap.config; | |
import java.util.Properties; | |
import javax.persistence.EntityManagerFactory; | |
import javax.sql.DataSource; | |
import org.hibernate.ejb.HibernatePersistence; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
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 UserRequiredAnnotationInterceptor extends HandlerInterceptorAdapter | |
{ | |
@Override | |
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception | |
{ | |
if (handler == null) | |
{ | |
return true; | |
} |
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 UserRequiredAnnotationInterceptor extends HandlerInterceptorAdapter | |
{ | |
@Override | |
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception | |
{ | |
if (handler == null) | |
{ | |
return true; | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration debug="false"> | |
<!-- if-then-else form --> | |
<if condition='property("profile").contains("PROD")'> | |
<then> | |
<property name="LOGGER_LEVEL" value="INFO" /> | |
<property name="CONSOLE_LOGGER_LEVEL" value="WARN" /> | |
</then> | |
<else> | |
<property name="LOGGER_LEVEL" value="INFO" /> |
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 SubscriptionClient createSubscriptionClient() { | |
//default sem timeouts | |
// PREFERRED_API_URL => http://subscription.bemobi.com.br/sc/ | |
// pode ser sobrescrita pelo pela propriedade de ambiente -Dcom.bemobi.subscription.client.host ou pelo | |
// método #setPreferredAddress(URL); | |
//SubscriptionJAXRSClient client = new SubscriptionJAXRSClient(); | |
int TIMEOUT_IN_MILIS = 35 * 1000; | |
int MAX_CONNECTION_IN_POOL = 100; | |
return new SubscriptionJAXRSClient(TIMEOUT_IN_MILIS, TIMEOUT_IN_MILIS, MAX_CONNECTION_IN_POOL); | |
} |
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
## API Gateway "Send Everything" Mapping Template - Ryan Green - ryang@ryang.ca | |
## See http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html | |
#set($allParams = $input.params()) | |
{ | |
"body-json" : "$input.json('$')", | |
"params" : { | |
#foreach($type in $allParams.keySet()) | |
#set($params = $allParams.get($type)) | |
"$type" : { | |
#foreach($paramName in $params.keySet()) |
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 | |
sox -n -r 44100 -c 2 silence.wav trim 0.0 2 | |
lame -b 32 --resample 8 -a silence.wav silence.mp3 |
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 com.lambdaworks.redis.RedisAsyncConnection; | |
import com.lambdaworks.redis.RedisClient; | |
import com.lambdaworks.redis.SetArgs; | |
import org.slf4j.Logger; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.CommandLineRunner; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import redis.clients.jedis.Jedis; | |
import redis.clients.jedis.JedisPool; |