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
(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] |
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
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; |
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
// POST /trigger { path: "" } | |
module.exports.trigger = async (event, context) => { | |
const id = uuid(); | |
await stepfunctions.startExecution({ | |
stateMachineArn: process.env.STATE_MACHINE_ARN, | |
input: JSON.stringify(event.body), | |
name: id | |
}); |
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
(ns list-classes-from-jar | |
(:import (java.util.jar JarFile))) | |
(def jar-file (JarFile. "target/s3-file-upload-sls-1.0.0-SNAPSHOT-standalone.jar")) | |
(def entries (.entries jar-file)) | |
(while (.hasMoreElements entries) | |
(let [entry (.nextElement entries)] | |
(println (.getName entry)))) |
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
service: aws-step-functions-showcase | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
iamRoleStatements: | |
- Effect: "Allow" | |
Action: | |
- "states:StartExecution" | |
Resource: |
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
service: my-service | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: ${opt:stage, 'dev'} | |
environment: | |
REDIS_HOST: | |
"Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address] | |
functions: |
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 pprint | |
import inspect | |
pp = pprint.PrettyPrinter(depth=6) | |
pp.pprint(inspect.getmembers(myObject)) |
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
var saml2 = require('saml2-js'); | |
const fs = require('fs'); | |
var express = require('express'); | |
var app = express(); | |
var bodyParser = require('body-parser'); | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})); | |
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 time-slot-ms 52) | |
(def truncate 10) | |
(defn ** [b e] | |
(reduce * (repeat e b))) | |
(defn with-exp-backoff [action!] | |
(loop [c 0] | |
(let [slot (* time-slot-ms (dec (** 2 c)))] | |
(println "Sleeping for " slot "ms.") |
NewerOlder