Skip to content

Instantly share code, notes, and snippets.

View codecitizen's full-sized avatar

amp codecitizen

  • Alexander Partsch
  • Vienna, Austria
View GitHub Profile
@codecitizen
codecitizen / ValidjacksonspringApplication.java
Created February 24, 2020 11:56
Example of using the `@Size` Annotation with Spring and Jackson.
package com.docutools.demo.validjacksonspring;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@codecitizen
codecitizen / issue387.clj
Created July 20, 2020 10:50
PF.tv Issue 387 Challenge
(ns issue387
(:require [clojure.string :as s]))
(defn asterisks [word]
(apply str (repeat (.length word) "*")))
(defn clean-word [sample word]
(s/replace sample (re-pattern (str "(?i)" word)) (asterisks word)))
(defn clean [sample index]