Skip to content

Instantly share code, notes, and snippets.

protected Object formBackingObject(HttpServletRequest request) throws ServletException;
public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception;
protected boolean isFormSubmission(HttpServletRequest request);
protected Map referenceData(HttpServletRequest request) throws Exception;
describe("when user is auth'd", function() {
before(function() {
Screw.Stub.stub(window, "getPortalData").andReturn({guid: '067416251802022009comcast.usr4jr',zip:'19103',wid:'19103'});
console.log(' before in auth user describe ' + getPortalData().zip);
});
describe(" and when localstorage is not available", function() {
console.log(' before in auth user describe -- innner ' + getPortalData().zip);
Prefs.remove(AdTargetingConstant.ADT_ZIP, Prefs.ADS);
/**
* Custom submit directive that will only submit when all the validation has passed
* for all the fields. This extends on the ng-submit directive provided by AngularJS.
*
* This directive will also remove the 'pristine' flag from all the fields when
* hitting submit, allowing the form to display no errors until the submit button
* is clicked/enter is pressed.
*
* The variable 'app' is the instance of a module.
* E.g. var app = angular.module('my-app', []);
@trmsmy
trmsmy / scala_ide.desktop
Created February 26, 2017 23:41
Ubuntu Desktop file for Scala
[Desktop Entry]
Type=Application
Name=Scala IDE
Comment=Scala Integrated Development Environment
Icon=/home/trmsmy/devtools/scala-ide/NEON/icon.xpm
Exec=/home/trmsmy/devtools/scala-ide/NEON/eclipse
Terminal=false
Categories=Development;IDE;Scala;Java;
StartupWMClass=Eclipse
@trmsmy
trmsmy / MultiLineTradeItemReader
Created May 23, 2017 02:48
Multi line record reader using PeekableItemReader
package com.trmsmy.spring.boot.batch.springbootbatch;
import java.util.ArrayList;
import java.util.List;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ItemStreamException;
package com.lca.phoenix.workq.rest.config;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@trmsmy
trmsmy / Service 2 and Service 3 logs
Created February 24, 2018 04:12
Spring Sleuth - trace ID is not passed to subsequent calls
2018-02-23 23:10:18.365 DEBUG [config-service,,,] 8212 --- [nio-8888-exec-1] o.s.c.sleuth.instrument.web.TraceFilter : Received a request to uri [/service2] that should not be sampled [true]
2018-02-23 23:10:18.369 DEBUG [config-service,,,] 8212 --- [nio-8888-exec-1] o.s.c.sleuth.instrument.web.TraceFilter : Found a parent span b927ff4389efc6c0/b927ff4389efc6c0 in the request
2018-02-23 23:10:18.369 DEBUG [config-service,,,] 8212 --- [nio-8888-exec-1] o.s.c.sleuth.instrument.web.TraceFilter : Parent span is NoopSpan{context=b927ff4389efc6c0/b927ff4389efc6c0}
2018-02-23 23:10:18.398 DEBUG [config-service,b927ff4389efc6c0,b927ff4389efc6c0,false] 8212 --- [nio-8888-exec-1] o.s.c.s.i.web.TraceHandlerInterceptor : Handling span NoopSpan{context=b927ff4389efc6c0/b927ff4389efc6c0}
2018-02-23 23:10:18.399 DEBUG [config-service,b927ff4389efc6c0,b927ff4389efc6c0,false] 8212 --- [nio-8888-exec-1] o.s.c.s.i.web.TraceHandlerInterceptor : Adding a method tag with value [echo] to a span NoopSpan{context=b927ff4389e
@trmsmy
trmsmy / SecurityConfig.java
Created March 2, 2018 15:53 — forked from yashpatil/SecurityConfig.java
Spring Security Java configuration for Pre-authenticated scenario
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDecisionVoter;
import org.springframework.security.access.vote.AffirmativeBased;
import org.springframework.security.access.vote.RoleVoter;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.ProviderManager;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
@trmsmy
trmsmy / template-java-after.xml
Created March 6, 2018 16:25 — forked from mnuessler/template-java-after.xml
Templates for the Eclipse IDE
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="true" context="java-members" deleted="false" description="tear down after test" enabled="true" name="after">@${afterType:newType(org.junit.After)}
public void tearDown() throws Exception {
${cursor}
}</template></templates>
@trmsmy
trmsmy / System Design.md
Created April 5, 2018 12:07 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?