Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html> <!-- important http://stackoverflow.com/a/21425218 -->
<html>
<head>
<link rel="stylesheet/less" type="text/css" href="nomoretables.less" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.5.3/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
</head>
<body>
<div style="position:relative">
@robshep
robshep / FullAddressLookup-lombok.java
Created February 22, 2016 11:24
ClickToAddress POJO Objects for Jackson/JSON (Both lombok annotated and de-Lombok-ed)
/**
* Uses Lombok to reduce boilerplate
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
package net._95point2.misc.docker;
import javax.sql.DataSource;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@robshep
robshep / PebbleStartApplication.java
Last active June 20, 2016 23:17
Change the syntax of pebble so you can also have Angular js templates.
package net._95point2.misc.pebble;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
@robshep
robshep / JsonWriterPebbleExtension.java
Last active September 4, 2022 03:18
Output arbitrary JSON into a pebble template.
@Component
public static class JsonWriterPebbleExtension extends AbstractExtension
{
@Autowired ObjectMapper objectMapper;
@Override
public Map<String, Function> getFunctions() {
HashMap<String, Function> functions = new HashMap<String,Function>();
functions.put("json", new JsonWriterPebbleFunction(objectMapper));
return functions;
@robshep
robshep / export_to_csv.plpsql
Created June 21, 2016 20:08
Export all tables to CSV files
DO
$$
DECLARE
rec record;
nbrow bigint;
BEGIN
FOR rec IN
SELECT *
FROM pg_tables
WHERE tablename NOT LIKE 'pg_%'
/**
* Source code derived from: https://github.com/thymeleaf/thymeleaf-extras-springsecurity/blob/3.0-master/thymeleaf-extras-springsecurity4/src/main/java/org/thymeleaf/extras/springsecurity4/auth/AuthUtils.java
*
* Thymeleaf is licensed under the Apache Software License (2.0) and has copyright assertions from the Thymeleaf team.
* As a derived works, this source code is also licensed under the Apache license (2.0)
*
* Original Notice:
* =============================================================================
*
* Copyright (c) 2011-2016, The THYMELEAF team (http://www.thymeleaf.org)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html><body>
<form action="file-upload.php" method="post" enctype="multipart/form-data">
Send these files:<br />
<input name="userfile[]" type="file" multiple /><br />
<input type="submit" value="Send files" />
</form>
</body></html>