Skip to content

Instantly share code, notes, and snippets.

@judell
judell / venn-diagram-svg.md
Created October 28, 2024 04:08
venn-diagram-svg
<svg viewBox="0 0 900 700" xmlns="http://www.w3.org/2000/svg">
    <!-- Background rectangle: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect 
         Using fill attribute to set background color -->
    <rect width="900" height="700" fill="#f5f5f5"/>
    
    <!-- Definitions for reusable elements: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs -->
    <defs>
        <!-- Filter effect for drop shadow: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/filter 
             Combines blur, offset and opacity adjustments -->
@judell
judell / venn-diagram-python.md
Last active October 28, 2024 04:05
venn-diagram-python
# Import necessary libraries
import matplotlib.pyplot as plt
from matplotlib_venn import venn2

# Set up the Venn diagram for Mermaid and Graphviz features with no fills, just thick black borders
plt.figure(figsize=(8, 6))
venn = venn2(subsets=(1, 1, 1), set_labels=("Mermaid", "Graphviz"))

# Label each section with unique and shared features
@judell
judell / votefwd-2.md
Created October 5, 2024 21:17
votefwd-2
Claude ChatGPT
@judell
judell / votefwd-1.md
Created October 5, 2024 21:17
votefwd-1
function parseHTML() {
Claude ChatGPT
@judell
judell / steampipe-aurora.md
Created September 25, 2024 18:33
steampipe-aurora

1. Run Steampipe as a Service

You can run Steampipe in service mode to expose it as a database endpoint. This allows you to connect to it from any Postgres-compatible client.

steampipe service start

2. Schedule or Trigger Data Pulls

You can use cron jobs or AWS Lambda functions to schedule or trigger Steampipe queries. Here’s an example using a cron job:

@judell
judell / translations.md
Last active September 11, 2024 21:18
translations

q1

   select
          by,
          sum(score) as sum_score
        from
          hn
        where
          time >= now() - interval '7 days'
@judell
judell / hn_unnest.hcl
Created September 10, 2024 20:51
hn_unnest
# duckdb
with names as (
select
unnest(string_to_array(?, ',')) as name
),
# sqlite
WITH RECURSIVE names(name, remaining) AS (
@judell
judell / hn_joined_lists.hcl
Created September 10, 2024 20:40
hn_joined_lists
locals {
joined_companies = join(",", local.companies)
joined_languages = join(",", local.languages)
joined_operating_systems = join(",", local.operating_systems)
joined_clouds = join(",", local.clouds)
joined_dbs = join(",", local.dbs)
joined_editors = join(",", local.editors)
}
@judell
judell / hn_mentions.hcl
Created September 10, 2024 20:30
hn_mentions
query "mentions" {
sql = <<EOQ
with names as (
select
unnest( $1::text[] ) as name
),
counts as (
select
name,
(
@judell
judell / hn_languages.hcl
Created September 10, 2024 20:27
hn_languages
languages = [
"C#",
"C\\+\\+",
"Clojure",
"CSS",
"Erlang",
"golang| go 1.| (in|with|using) go | go (.+)(compiler|template|monorepo|generic|interface|library|framework|garbage|module|range|source)",
"Haskell",
"HTML",
"Java ",