Skip to content

Instantly share code, notes, and snippets.

@lambrospetrou
lambrospetrou / test-upstash-redis.go
Created August 26, 2022 14:27
Use Upstash Redis - rest and native clients from Go
package main
import (
"bufio"
"context"
"log"
"net/http"
"sync"
"time"
package main
import (
"bufio"
"context"
"log"
"net/http"
"os"
"strconv"
"sync"
@lambrospetrou
lambrospetrou / git-sparse-checkout-specific-folder-demo.sh
Created December 14, 2022 23:46
Git sparse checkout only specific directories of a repo
BRANCH_NAME="master"
# Clone the repository .git information only
# Docs: https://git-scm.com/docs/git-clone
#
# --no-checkout :: Do not fetch any files, only the `.git` directory.
# --sparse :: Only files at the top-level directory, at the root of the repository, will be part of the checkout.
# --branch <branch_name> :: Only fetch the information for the given branch.
# --depth 1 :: Only fetch the tip commit, HEAD of the specified branch.
# --filter=blob:none :: Do not download any blob files.
package main
import (
"database/sql"
"context"
"fmt"
"log"
"time"
"os"
@lambrospetrou
lambrospetrou / readme.md
Last active January 19, 2024 12:39
DuckDB JSON to Parquet in S3

DuckDB JSON to Parquet

Command to generate sample NDJSON files:

copy (select * from (select a.range as 'a' from range(1000) as a), (select b.range as 'b' from range(1000) as b)) to 'range.ndjson';

Creates a 2x1000000 table:

select count(1) from 'range.ndjson';
┌──────────┐