Skip to content

Instantly share code, notes, and snippets.

@duese22
duese22 / code of sreekanthmcit
Last active December 4, 2019 12:03
Fix Set-User for Link
@PostMapping("/link/submit")
public String createLink(@Valid Link link, BindingResult bindingResult, Model model, RedirectAttributes redirectAttributes){
User user = null;
Optional optionalemail = BeanUtil.getBean(AuditorAwareImpl.class).getCurrentAuditor();
if(optionalemail.isPresent()) {
Optional optionalUser = userRepository.findByEmail((String) optionalemail.get());
if(optionalUser.isPresent()){
user = (User) optionalUser.get();
}else{
user = null;
@duese22
duese22 / GpxTrackNameChanger.py
Created November 1, 2019 16:53 — forked from ptrv/GpxTrackNameChanger.py
Change track names in GPX files (python)
#!/usr/bin/python
# Script for assigning the date of a track in a GPX file as track name.
#
# Usage e.g $ python ChangeGpxTrackName.py source.gpx target.gpx"
#
# Peter Vasil
# Date: 2011-02-05
from optparse import OptionParser