Skip to content

Instantly share code, notes, and snippets.

public class RGBConverter {
public static class RGBCode{
public int red;
public int blue;
public int green;
public RGBCode(int red, int blue, int green){
this.red = red;
public class DigitCounter {
public static void main(String[] args) {
int total = 0;
for (int count = 1; count <= 1000000; count++) {
int[] digits = Integer.toString(count).chars().map(c -> c -= '0').toArray();
for (int d : digits) {
total = total + d;
@mrisney
mrisney / RequestAndResponseLoggingFilter.java
Created November 27, 2018 22:50 — forked from int128/RequestAndResponseLoggingFilter.java
Spring Web filter for logging request and response
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.web.util.ContentCachingRequestWrapper;
import org.springframework.web.util.ContentCachingResponseWrapper;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
@mrisney
mrisney / jquerybuilder-autocomplete-example.html
Last active February 26, 2023 04:50
jQuery QueryBuilder autocomplete example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jquerybuilder autocomplete example</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.2.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jQuery-QueryBuilder/2.6.2/css/query-builder.default.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.13.6/css/selectize.min.css">