Skip to content

Instantly share code, notes, and snippets.

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@lambrospetrou
lambrospetrou / go-single-file-script-README.md
Last active October 10, 2024 12:28
Go script using gorun in a single file
@lambrospetrou
lambrospetrou / deploy-ssh.sh
Created September 6, 2024 07:06
Simple deployment on a VPS, Hetzner, EC2 with zero downtime. Uses Caddy and systemd.
#!/usr/bin/env bash
# Inspired from:
# - https://blog.wesleyac.com/posts/simple-deploy-script
# - https://gist.github.com/WesleyAC/b3aaa0292579158ad566c140415c875d
# - https://caddyserver.com/docs/running#using-the-service
set -e
# cd $(dirname $0)
@lambrospetrou
lambrospetrou / tailwind.config.js
Created August 29, 2024 07:45 — forked from eduardolat/tailwind.config.js
Regex for TailwindCSS + Gomponents
/** @type {import('tailwindcss').Config} */
module.exports = {
// Change this to your project source folder
content: ['./web/**/*.go'],
plugins: [],
theme: {
extend: {},
}
}
@lambrospetrou
lambrospetrou / falsehoods-programming-time-list.md
Created August 4, 2024 10:17 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@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';
┌──────────┐
package main
import (
"database/sql"
"context"
"fmt"
"log"
"time"
"os"
@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.