This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN | |
IF EXISTS (SELECT * FROM tempdb.sys.tables WHERE name LIKE '#dbFiles%') | |
DROP TABLE #dbFiles | |
END | |
EXEC master.dbo.sp_configure 'show advanced options', 1 | |
RECONFIGURE | |
EXEC master.dbo.sp_configure 'xp_cmdshell', 1 | |
RECONFIGURE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE myDatabase | |
SELECT 'exec master..xp_cmdshell' | |
+ ' ''' | |
+ 'bcp' | |
+ ' ' + TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME | |
+ ' out' | |
+ ' E:\releasedDB\prod\' | |
+ TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME + '.csv' | |
+ ' -c' | |
+ ' -t,' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
@Table(name = "ParentEntity") | |
public class ParentEntity { | |
@Id | |
@GeneratedValue | |
@Column(name= "ParentId") | |
private long parentId; | |
@ElementCollection(fetch = FetchType.EAGER) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SecurityContextWrappedMultipartRequestArgumentResolver implements WebArgumentResolver { | |
private final CommonsMultipartResolver commonsMultipartResolver; | |
public SecurityContextWrappedMultipartRequestArgumentResolver(){ | |
this.commonsMultipartResolver = new CommonsMultipartResolver(); | |
} | |
@Override | |
public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'idea' | |
idea { | |
project { | |
ipr.withXml { | |
// Create a task to run gradle testClasses, which we will subsequiently bind to Default JUnit runner to | |
def runConfigComp = it.node.appendNode('component') | |
def runOpts = [ | |
"default": "false", | |
"name": "testClasses for JUnit", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
long sum = 0 | |
byte overflow; | |
String text = 'mystring' | |
for (int i =0; i< text.length(); i++){ | |
sum = (long)((16* sum) ^ text.getBytes()[i]) | |
overflow = (byte) (sum / 4294967296) | |
sum = sum - overflow * 4294967296 | |
sum = sum ^ overflow | |
} | |
if (sum > 2147483647) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String s = '0x7B2274797065223A226469636F6D2E736572696573222C227374756479496E7374616E6365556964223A22312E332E362E312E342E312E32353430332E39373339343437353933333536392E363634302E32303133303531303033313330322E32222C226172636869766555726C223A22687474703A2F2F687474703A2F2F6C6F63616C686F73743A383730302F6D616E6167656D656E742F6170692F61726368697665732F64656661756C742F737475646965732F312E332E362E312E342E312E32353430332E39373339343437353933333536392E363634302E32303133303531303033313330322E32222C226D696E7455726C223A22687474703A2F2F6C6F63616C686F73743A383735302F646174612F6170692F737475646965732F312E332E362E312E342E312E32353430332E39373339343437353933333536392E363634302E32303133303531303033313330322E32222C22736572696573496E7374616E636555696473223A5B22312E332E362E312E342E312E32353430332E39373339343437353933333536392E363634302E32303133303531303033313330352E3135225D2C2261747472696275746573223A7B22426F6479506172744578616D696E6564223A224368657374222C2243617264696163506861736550657263656E74223A22222C22496D616765436F6D6D656E7473 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@Profile("dev") | |
public class DevWebResourceAdapter extends WebMvcConfigurerAdapter { | |
@Override | |
public void addResourceHandlers(ResourceHandlerRegistry registry) { | |
registry.addResourceHandler("/**") | |
.addResourceLocations("file:./submodule-web/app/"); | |
registry.addResourceHandler("/bower_components/**") | |
.addResourceLocations("file:./submodule-web/bower_components/"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add net.sf.corn:corn-cps:1.0.1 to your classpath | |
import net.sf.corn.cps.* | |
import org.springframework.stereotype.Controller | |
import org.springframework.web.bind.annotation.RequestMapping | |
import org.springframework.security.access.prepost.PreAuthorize | |
def classes = CPScanner.scanClasses(new PackageNameFilter("com.company.*"), new ClassFilter().appendAnnotation(Controller)) | |
classes.each { clazz -> | |
clazz.getDeclaredMethods().each { method -> | |
RequestMapping mapping = method.getAnnotation(RequestMapping) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
maven { | |
name = 'BintrayJCenter' | |
url = 'http://jcenter.bintray.com' | |
} | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'us.carrclan.david.gradle:gradle-site-plugin:0.2.0' |
OlderNewer