Skip to content

Instantly share code, notes, and snippets.

View m-x-k's full-sized avatar

Martin Kelly m-x-k

View GitHub Profile
@m-x-k
m-x-k / gist:a75afe262c8d94cdbfbe70ca285700c5
Created November 25, 2018 11:01
Spring Boot configuration: JSP access
@Configuration
@EnableWebMvc
public class WebApplicationConfig implements WebMvcConfigurer {
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.jsp().prefix("/WEB-INF/views/").suffix(".jsp");
}
}
@m-x-k
m-x-k / map_filter_reduce_examples.py
Created January 4, 2019 15:32
Python Map Filter Reduce examples
from functools import reduce
check = [1, 2, 3, 4, 5]
if __name__ == '__main__':
print(list(map(lambda x: x * 3, check))) # OUTPUT: [3, 6, 9, 12, 15]
print(list(filter(lambda x: x < 3, check))) # OUTPUT: [1, 2]
@m-x-k
m-x-k / delete-pods.sh
Created March 15, 2019 11:33
Delete all openshift pods in a project space
#!/bin/bash
oc login
oc project $1
oc get services | awk '{print $1}' | grep -v NAME | xargs -I % oc delete all -l app=%