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
#!/usr/bin/env python | |
import random | |
import sys | |
def hex_strs_to_ansi(hex_strs): | |
assert isinstance(hex_strs, list) | |
res = [] | |
for col in hex_strs: |
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
#!/usr/bin/env -S python3 -u | |
import csv | |
import datetime | |
import glob | |
import gzip | |
import json | |
import os | |
import sys | |
import time | |
import hashlib |
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 faulthandler | |
import multiprocessing | |
import os | |
import signal | |
def run_buggy(): | |
shutdown_event = multiprocessing.Event() | |
def sigterm_handler(_signo, _stack_frame): |
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 time | |
import os | |
from datetime import datetime | |
columns, lines = os.get_terminal_size() | |
def write(s): | |
print(s, end="") | |
# time.sleep(0.02) |
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
# based on https://mdk.fr/blog/how-apt-does-its-fancy-progress-bar.html | |
# to run: python -u ./demo.py | |
# notice the -u for unbuffered | |
import time | |
import os | |
from datetime import datetime | |
columns, lines = os.get_terminal_size() |
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
#!/usr/bin/env bb | |
(ns tray-tail | |
(:require [clojure.java.io :as io] | |
[clojure.string :as str] | |
[cheshire.core :as json] | |
[babashka.http-client :as http]) | |
(:import (java.io File) | |
(java.net URLEncoder) | |
(java.time ZonedDateTime) | |
(java.time.format DateTimeFormatter) |
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 no.nsd; | |
import java.awt.*; | |
import java.awt.event.*; | |
import java.io.IOException; | |
import java.net.ConnectException; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.net.http.HttpClient; | |
import java.net.http.HttpRequest; |
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 user.db.transact-assert-basis-t | |
(:require [clojure.edn :as edn] | |
[clojure.stacktrace :as st] | |
[datomic.api :as d]) | |
(:import (clojure.lang IBlockingDeref IDeref IPending) | |
(datomic Connection) | |
(java.util.concurrent Future TimeUnit TimeoutException))) | |
(def schema | |
"transact-assert-basis-t requires a single function present in the transactor: this function. |
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 com.github.ivarref.clj-paginate.ticker | |
(:require [clojure.string :as str]) | |
(:import (clojure.lang IFn) | |
(java.lang AutoCloseable))) | |
(def is-cursive? | |
(try | |
(require '[cursive.repl.runtime]) | |
true | |
(catch Exception _ |
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 com.github.ivarref.cas-should-resolve-tempid-string | |
(:require [clojure.test :as test :refer [deftest is]] | |
[datomic.api :as d])) | |
(def ^:dynamic *conn* nil) | |
(def test-schema | |
[#:db{:ident :e/id, :cardinality :db.cardinality/one, :valueType :db.type/string :unique :db.unique/identity} | |
#:db{:ident :e/info, :cardinality :db.cardinality/one, :valueType :db.type/string} | |
#:db{:ident :e/version, :cardinality :db.cardinality/one, :valueType :db.type/long}]) |
NewerOlder