This file contains 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
def icalA() | |
{ | |
def start = new Date(114,11,22,19,10,0) | |
def end = new Date(114,11,22,20,0,0) | |
render( contentType: params.format == 'ics' ? 'text/calendar' : 'text/plain', filename: "ical-a.ics") { | |
calendar { | |
events { | |
event( | |
start: start, | |
end: end, |
This file contains 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
/** | |
* @author Silvio Wangler | |
*/ | |
def logger = container.logger | |
def server = vertx.createHttpServer().requestHandler { req -> | |
logger.info "Proxying request: ${req.uri}. Going to url ${req.params.url}" |
This file contains 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
def baseName = '3.05.BUILD-' | |
def version = '161' | |
def composedName = "${baseName}${version}" | |
def rootDir = new File('/home/saw/.gradle/caches/artifacts-24/filestore/com.adcubum.syrius') | |
assert rootDir.exists() && rootDir.canWrite() | |
def killList = [] |
This file contains 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
@ContextConfiguration("classpath:applicationContextRestIntegrationTest.xml") | |
@ActiveProfiles(['local', 'compliance']) | |
@TestExecutionListeners([DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class]) | |
class RestSpec extends Specification implements JaxrsInterceptorRegistryListener { | |
@Autowired | |
ApplicationContext applicationContext | |
@Autowired | |
KsdApiSchemaRequestFilter filter |
This file contains 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
SELECT table_schema "DB Name", | |
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" | |
FROM information_schema.tables | |
GROUP BY table_schema; |
This file contains 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
import java.security.MessageDigest | |
import java.security.NoSuchAlgorithmException | |
import java.security.SecureRandom | |
def password = 'my pwd' | |
def username = 'a users name' | |
def passwordToHash = "${password}{${username}}" | |
MessageDigest md = MessageDigest.getInstance 'SHA-512' | |
byte[] bytes = md.digest passwordToHash.getBytes() |
This file contains 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
#!/bin/bash | |
for f in /tmp/*.{JPG,jpg,PNG,png}; | |
do | |
FILE="$f.webp" | |
if [ ! -f $FILE ] | |
then | |
echo "Converting image $f to $(basename $f).webp"; | |
else | |
echo "WebP image $(basename $f).webp does exist"; |