Skip to content

Instantly share code, notes, and snippets.

Anatoli avk2

  • Spain
Block or report user

Report or block avk2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:c2ac092d4146a0560eef7d66c55f6776
class foo {
@EmbeddedId
FooPK pk;
}
@Embeddable
class fooPK {
Long id1;
Long id2;
View gist:e48849749891d57efc802f9f932cd575
JPAQuery<ServicioResumenProj> query = jpaQueryFactory
.select(Projections.fields(ServicioResumenProj.class,
qServicio.pk,
qServicio.estado,
qServicio.fechaHoraAlta,
qServicio.fechaHoraPrevistaEnvioAmbulancia,
qServicio.viaje,
qServicio.paciente,
qServicio.zona,
qServicio.plantilla,
View gist:ad5786cccd95e813d920116e784832e0
public interface ServicioResumen {
ServicioPK getPk();
Servicio.Estado getEstado();
ZonedDateTime getFechaHoraAlta();
ZonedDateTime getFechaHoraPrevistaEnvioAmbulancia();
ViajeId getViaje();
PacienteResumen getPaciente();
Zona getZona();
PlantillaId getPlantilla();
View gist:e2a94e852ad65ff33f4874b74ec90eec
@Configuration
public class JacksonConfig {
@Bean
public Module customSerializer() {
SimpleModule module = new SimpleModule();
module.addSerializer(new NullSerializer());
return module;
}
}
View gist:ee332737e6ab578f0c29cdf4717adb89
@Configuration
@EnableWebSecurity
//@EnableGlobalMethodSecurity //not sure which one to use
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
// http.authorizeRequests()
// .antMatchers("/login**").permitAll()
// .anyRequest().authenticated();
View gist:c0f27f0286d64429ec6ce43b60621e70
private void setActiveUser(User user, HttpServletRequest request) {
try {
// Must be called from request filtered by Spring Security, otherwise SecurityContextHolder is not updated
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(user, null);
token.setDetails(new WebAuthenticationDetails(request));
Authentication authentication = authenticationProvider.authenticate(token);
SecurityContextHolder.getContext().setAuthentication(authentication);
log.debug("Current user [{}]", authentication.getPrincipal());
} catch (Exception e) {
SecurityContextHolder.getContext().setAuthentication(null);
View gist:cd091a19bcbe6d82e392542e17a79fda
@Component
public class CustomAuthenticationProvider implements AuthenticationProvider {
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
return authentication;
}
@Override
public boolean supports(Class<?> aClass) {
View gist:a91d93688dff59ca4b9d24882b3c851b
@Component
public class CustomDBAppender extends AppenderBase<ILoggingEvent> {
private final FooRepo fooRepo;
@Autowired
public CustomDBAppender(FooRepo fooRepo) {
this.fooRepo = fooRepo;
}
View gist:9886ad701cadc42297984ccca0c4cdf4
ERROR: ld.so: object '/home/ender/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
/bin/sh: 1: /home/ender/.local/share/Steam/steamapps/common/BATTALION 1944 TEST ZONE/Battalion: Permission denied
>>> Adding process 12494 for game ID 640100
GameAction [AppID 640100, ActionID 1] : LaunchApp changed task to WaitingGameWindow with ""
>>> Adding process 12495 for game ID 640100
GameAction [AppID 640100, ActionID 1] : LaunchApp changed task to Completed with ""
Game removed: AppID 640100 "", ProcID 12494
No cached sticky mapping in ActivateActionSet.
View .js
db.getCollection('companies').update(
// query
{
"key" : "value"
},
// update
{
},
You can’t perform that action at this time.