View groovySqlCopyData.groovy
import groovy.sql.Sql
import groovy.transform.Canonical
import groovy.transform.Field
Sql casinoDb = Sql.newInstance('jdbc:oracle:thin:@host1:1521/testdb1', 'uname', 'passwd')
Sql ewDb = Sql.newInstance('jdbc:oracle:thin:@host2:1521/testdb' , 'uname', 'passwd')
def sourceDataSql = new File('/some/file/path.sql').text
@Canonical
View UniqueByPojoField.java
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import com.google.common.collect.Maps;
public class UniqueByPojoField {
View TreeVisitor.groovy
package com.panbet.tree
import groovy.transform.ToString
import spock.lang.Shared
import spock.lang.Specification
/**
* Simple example of deep-first and breath-first tree traversal
* Sample tree
* <pre>
View FSMonTest.groovy
package com.panbet.tree
import org.apache.commons.io.IOCase
import org.apache.commons.io.monitor.FileAlterationListener
import org.apache.commons.io.monitor.FileAlterationMonitor
import org.apache.commons.io.monitor.FileAlterationObserver
import static org.apache.commons.io.filefilter.FileFilterUtils.*
View logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds" debug="true">
<property name="FILE_LOG_PATTERN"
value="%d{dd/MM HH:mm:ss:SS} %level [%thread] %logger{10} [%file:%line] %msg%n"/>
<property name="LOG_PATH"
value="#[[$logPrefix$]]#" />
<!-- APPLICATION LOGGING-->
View getters-to-builder.groovy
import groovy.text.SimpleTemplateEngine
import java.lang.reflect.Method
def classFQN = args.length > 0? args[0]: System.exit(1)
Class<?> clazz = Class.forName(classFQN, false, getClass().getClassLoader())
class BuilderTemplateWrapper {
final Class<?> clazz
View govorim-pravilno.m3u
#EXTM3U
#EXTINF:2061, Норма современного языка
http://audio.vgtrk.com/listen?id=1359030
#EXTINF:2539, Языковые изменения и проблемы орфографии
http://audio.vgtrk.com/listen?id=1360215
#EXTINF:2105, Латиница и кириллица: соперники или союзники?
http://audio.vgtrk.com/listen?id=1360846
#EXTINF:2223, Паронимы
http://audio.vgtrk.com/listen?id=1362651
#EXTINF:2035, Омонимы
View DemoController.java
public interface DemoInterface {
HelloMsg sayHelloImpl(AddresseeRequest request);
@RequestMapping(value = "/hello")
default HelloMsg sayHello(@RequestBody AddresseeRequest request) {
return sayHelloImpl(request);
}
}
@RestController
View brendyatina.m3u
#EXTM3U
#EXTINF:1874, Metro-Goldwyn-Mayer
http://audio.vgtrk.com/listen?id=810182
#EXTINF:1427, Xerox
http://audio.vgtrk.com/listen?id=810233
#EXTINF:1491, Versace
http://audio.vgtrk.com/listen?id=810269
#EXTINF:1463, Siemens
http://audio.vgtrk.com/listen?id=810321
#EXTINF:1374, Хоккей
View gist:7f5a48f30cdf6a6d87e71e793fb2d589
// Useful for students in need of block quotes for their paper, etc.
// Execute the line in your JavaScript console
new_window=window.open();new_window.document.body.innerHTML = $('iframe').contents().find('iframe').contents().find('body').get(1).innerHTML;
javascript:new_window=window.open();new_window.document.body.innerHTML = $('iframe').contents().find('iframe').contents().find('body').get(1).innerHTML;