Skip to content

Instantly share code, notes, and snippets.

View joshdurbin's full-sized avatar

Josh Durbin joshdurbin

View GitHub Profile
@joshdurbin
joshdurbin / read_perf.txt
Last active April 11, 2025 17:33
non c-go sqlite per testing
➜ sqlitetest time ./main
=== SQLite Load Testing Program ===
Database path: ./people.db
=== DATABASE ALREADY CONTAINS 3230001 RECORDS ===
Proceeding with queries...
=== QUERY BY SSN TIMING ===
Running 1000 random SSN queries...
Queried 100/1000 SSNs (23728.07 queries/sec, 10.00% complete)
@joshdurbin
joshdurbin / generategcsdata.go
Last active March 13, 2024 15:52
Generate random files in GCS
package main
import (
"cloud.google.com/go/storage"
"context"
"fmt"
"math/rand"
"os"
"os/signal"
"sync"
@joshdurbin
joshdurbin / redis_data_gen_replica_lag_check.go
Last active May 30, 2024 23:54
Redis content generator and concurrent poller of replicas
package main
import (
"context"
"flag"
"fmt"
"github.com/redis/go-redis/v9"
"golang.org/x/sync/errgroup"
"math/rand"
"net"
Programmatic finished in 687498 ms
Programmatic finished in 1152935 ms
Ran calculations 1000000000 times. Results:
|-----------------------------------|
| Flips | Programmatic | Mathy |
|-----------------------------------|
| 0 | 499999527 | 499991146 |
| 1 | 249993072 | 249998627 |
| 2 | 125001055 | 125011612 |
match (p:person)-[:transact]->(:order)-[:contain]->(:product)<-[:contain]-(:order)-[:contain]->(prd:product) where p.id=294 return distinct prd limit 1
redis graph
https://youtu.be/JNpHba2kRGM
https://youtu.be/aGHALjV6JGc
https://youtu.be/FC4PVQpwhqQ
@joshdurbin
joshdurbin / 1.groovy
Created April 27, 2020 23:32
2020-2-groovy-concurrent-redis-operations-with-jedis
#!/usr/bin/env groovy
@Grapes([
@Grab(group='redis.clients', module='jedis', version='3.2.0'),
@Grab(group='org.slf4j', module='slf4j-nop', version='1.7.30')
])
import redis.clients.jedis.JedisPool
def jedisPool = new JedisPool()
package main
import (
"flag"
"github.com/thoas/go-funk"
"log"
"time"
)
type result struct {
@Grapes([
@Grab(group='org.apache.pdfbox', module='pdfbox', version='2.0.13'),
@Grab(group='org.apache.tika', module='tika-core', version='1.18'),
@Grab(group='me.xdrop', module='fuzzywuzzy', version='1.2.0')
])
import org.apache.pdfbox.pdmodel.PDDocument
import org.apache.pdfbox.text.PDFTextStripper
import org.apache.tika.Tika
import java.util.concurrent.ConcurrentLinkedQueue
from __future__ import division
import sheep
from color import RGB
A = [1, 3, 4, 7, 9, 12, 16, 18, 19, 21, 22, 24, 27, 30, 33, 35, 37, 39, 42]
B = [2, 5, 6, 8, 11, 13, 14, 15, 17, 20, 23, 25, 26, 28, 29, 31, 32, 34, 36, 40, 41, 43]
class Josh(object):