Skip to content

Instantly share code, notes, and snippets.

View SSYH's full-sized avatar
💭
Thinking about how to set up repositories here to support GCC

Sam Hahn SSYH

💭
Thinking about how to set up repositories here to support GCC
View GitHub Profile
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
# Replace the '❯' symbol in the prompt with '➜'
[character] # The name of the module we are configuring is 'character'
success_symbol = '[➜](bold green) '
error_symbol = '[✗](bold red) '
@SSYH
SSYH / transcounter.clj
Created February 26, 2023 06:19
Transaction Counter
(java.util.Date. )
(require '[clojure.string :as str])
(require '[clojure.edn :as edn])
(defn map-from-string [xstr]
"Warning:
potential security vulnerability in clojure.core/read-string.
(https://clojuredocs.org/clojure.edn)"
(edn/read-string (str "{" xstr "}")))
@SSYH
SSYH / ChatTranscriptReader.clj
Last active February 26, 2023 06:20
Chat transcript reader
;;; what time is it?
;;; (java.util.Date. )
(defn trans-counter [percent-encoded-session]
"If the argument is a URLencoded string representing an eGain chat session,
this produces a map of utterance counts by source (system, agent, customer) and total count"
(let [decoded-string (decode-content percent-encoded-session)]
{:sm (count (re-seq #"\{SYSTEM\}transType" decoded-string))
:am (count (re-seq #"\{AGENT\}transType" decoded-string))
:cm (count (re-seq #"\{CUST\}transType" decoded-string))

Keybase proof

I hereby claim:

  • I am SSYH on github.
  • I am SamHahn (https://keybase.io/SamHahn) on keybase.
  • I have a public key ASANHO0sW4fpqp_GizqWZINLFlt8BnytksINXjCIFPlXqgo

To claim this, I am signing this object: