Skip to content

Instantly share code, notes, and snippets.

View tobiasosDev's full-sized avatar
🎯
Focusing

Tobias Lüscher tobiasosDev

🎯
Focusing
View GitHub Profile
@tobiasosDev
tobiasosDev / preserve.js
Last active May 6, 2020 11:18
preserve log, chrome from redirect. So you can debug without redirect
window.addEventListener("beforeunload", function() { debugger; }, false)
@tobiasosDev
tobiasosDev / createMenuWithDefaultObject.js
Last active July 19, 2019 06:08
[Default Object in Function] Default Values for a function with Object.assign #JavaScript
function createMenu(config) {
config = Object.assign(
{
title: "Foo",
body: "Bar",
buttonText: "Baz",
cancellable: true
},
config
);
@tobiasosDev
tobiasosDev / regexMatcher.js
Last active July 19, 2019 05:19
[Regex Const Array] nice way to match multiple groups at same time #JavaScript #Regex
const address = "One Infinite Loop, Cupertino 95014";
const cityZipCodeRegex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/;
const [, city, zipCode] = address.match(cityZipCodeRegex) || [];
@tobiasosDev
tobiasosDev / configuration.java
Last active July 19, 2019 05:20
[Dozer Mapper Spring Boot] Spring Dozer Config #Java #Spring
@org.springframework.context.annotation.Configuration
public class Configuration {
@Bean(name = "org.dozer.Mapper")
public DozerBeanMapper dozerBean() {
List<String> mappingFiles = Arrays.asList(
"dozerMapper.xml"
);
DozerBeanMapper dozerBean = new DozerBeanMapper();