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 main | |
import ( | |
"fmt" | |
"os" | |
"slices" | |
"golang.org/x/net/html" | |
) |
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 itertools | |
import pandas as pd | |
LIMIT = 100 | |
def get_logs(page_number: int): | |
r = requests.get( | |
"https://ecomedes-prod.us.auth0.com/api/v2/logs", | |
headers={ |
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
from abc import ABC, abstractmethod | |
import csv | |
from typing import * | |
T = TypeVar("T") | |
class FromRow(ABC, Generic[T]): | |
""" | |
A class that can be constructed from a row of CSV data. |
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
use std::path::PathBuf; | |
use crates_index; | |
fn main() { | |
let index = crates_index::Index::new(PathBuf::from("./cargo_index")); | |
if !index.exists() { | |
index | |
.retrieve() |
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
use std::path::PathBuf; | |
use crates_index; | |
fn main() { | |
let index = crates_index::Index::new(PathBuf::from("./cargo_index")); | |
if !index.exists() { | |
index | |
.retrieve() |
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
user> (go) ;; start my dev system | |
Syntax error (ClassNotFoundException) compiling at (dev.clj:1:1). | |
clojure.core.async.Mutex | |
ERROR: Unhandled REPL handler exception processing message {:nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70}, :op stacktrace, :session 5e397a7b-f0de-4453-bef1-bd98950e98ba, :id 8} | |
java.lang.NoClassDefFoundError: Could not initialize class clojure.core.async.impl.channels__init | |
at java.base/java.lang.Class.forName0(Native Method) | |
at java.base/java.lang.Class.forName(Class.java:398) | |
at clojure.lang.RT.classForName(RT.java:2211) | |
at clojure.lang.RT.classForName(RT.java:2220) | |
at clojure.lang.Compiler.maybeResolveIn(Compiler.java:7438) |
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
(defn tree-seq | |
"Returns a lazy sequence of the nodes in a tree, via a depth-first walk. | |
branch? must be a fn of one arg that returns true if passed a node | |
that can have children (but may not). children must be a fn of one | |
arg that returns a sequence of the children. Will only be called on | |
nodes for which branch? returns true. Root is the root node of the | |
tree." | |
{:added "1.0" | |
:static true} | |
[branch? children root] |
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 bash | |
set -e | |
host=${1:-"`minikube ip`:30200"} | |
old_indexes=$(curl "$host/_all" | \ | |
jq -r 'to_entries | map(select(.value.aliases|has("ecomedes")|not)) | map(.key) | map(select( . != "migrations"))|.[]') | |
for i in $old_indexes; do |
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 ecomedes.lmdb | |
(:refer-clojure :exclude [read]) | |
(:require [clojure.java.io :as io] | |
[com.stuartsierra.component :as comp] | |
[taoensso.nippy :as nippy]) | |
(:import [org.lmdbjava | |
CursorIterator | |
DbiFlags | |
Env | |
EnvFlags |
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
(defmacro layout | |
[layout] | |
(let [args-destructurer (into {} (comp (remove (comp not symbol?)) | |
(map (juxt identity (comp keyword name)))) | |
(flatten layout))] | |
`(fn [~args-destructurer] | |
~layout))) | |
(def layouts | |
{:default-with-sorts |
NewerOlder