This file contains hidden or 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
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
import sys | |
import tkinter as tk | |
class AnimatedTextApp: | |
def __init__(self, root, title="Animated Text"): | |
self.root = root |
This file contains hidden or 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
SELECT | |
c.name, | |
(wl.wishes).first_choice AS primary_wish, | |
(wl.wishes).second_choice AS backup_wish, | |
(wl.wishes).colors[1] AS favorite_color, | |
LENGTH((wl.wishes).colors) AS color_count, | |
CASE | |
WHEN tc.difficulty_to_make = 1 THEN 'Simple Gift' | |
WHEN tc.difficulty_to_make = 2 THEN 'Moderate Gift' | |
WHEN tc.difficulty_to_make >= 3 THEN 'Complex Gift' |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# MIT License | |
# Copyright (c) 2023-2024 Håkan Råberg and Steven Deobald | |
# Copyright (c) 2024 JUXT Ltd | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
This file contains hidden or 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
(defn relate [& pairs] | |
(assert (even? (count pairs)) "relate requires an even number of arguments") | |
(->> pairs | |
(partition 2) | |
(map (fn [[k vs]] (map #(hash-map k %) vs))) | |
(apply map merge))) | |
(defn matches-specmap? [specmap m] | |
(reduce-kv |
This file contains hidden or 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 excel.api.s3 | |
(:require [cognitect.aws.client.api :as aws] | |
[integrant.core :as ig] | |
[clojure.tools.logging :as log])) | |
(defmethod ig/init-key ::client | |
[_ _] | |
(create-s3-client)) | |
;; Code below may end up being a periodic background process for limiting s3 |
This file contains hidden or 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
;; Assumes https://github.com/jstepien/flames available | |
;; requires http://riemann.io to be installed. | |
(def flames (atom nil)) | |
(defn flames-start! [] | |
;; We resolve explicitly here, to avoid warnings when not working | |
;; with flamegraphs | |
(if-not @flames | |
(let [config {:port 54321, :host "localhost"}] | |
(reset! flames ((requiring-resolve 'flames.core/start!) config)) |
This file contains hidden or 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
(-> (java.lang.management.ManagementFactory/getRuntimeMXBean) | |
(.getName) | |
(clojure.string/split #"@") | |
(first)) |
This file contains hidden or 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
(defn visit [m visitors] | |
;; [node node-s next-s down-s right-s get-right get-down init-right-s cut-down cut-right :as m] | |
;; {:keys [break]} next-s | |
;; ;use next-state by default, unless down or right is necessary | |
(let | |
[dovisit (fn [m dir] | |
(loop [s m [v & vs] visitors] | |
(if v (recur (apply v (concat [dir] s)) vs) s))) | |
m2 (dovisit m :pre) | |
;break/cut checks should be between each visitor (:pre :post and :in) according to zip-visit |
NewerOlder