See the new site: https://postgresisenough.dev
This file contains hidden or 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
| -- Copy file path / selection reference for pasting into AI chats | |
| local function copy_ref(opts) | |
| -- "%" is the current buffer's file name; ":." makes it relative to the cwd | |
| local path = vim.fn.expand("%:.") | |
| -- ref is what ends up in the clipboard; start with just the path | |
| local ref = path | |
| if opts.visual then | |
| -- '< and '> are only set after leaving visual mode, so read the live selection: | |
| -- "v" is the line where visual mode was started (the anchor) |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Fullscreen Image Viewer</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| } |
This file contains hidden or 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
| Source: https://github.com/zed-industries/community/issues/1526#issuecomment-1543891012 | |
| { | |
| // ... | |
| "language_overrides": { | |
| "Elixir": { | |
| "format_on_save": { | |
| "external": { | |
| "command": "mix", | |
| "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"] | |
| } |
This file contains hidden or 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
| defmodule SupportChat do | |
| import Phoenix.Component | |
| alias Phoenix.LiveView.JS | |
| @doc """ | |
| Chat bubble at the bottom right corner. | |
| """ | |
| def bubble(assigns) do | |
| ~H""" | |
| <div> |
This file contains hidden or 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
| /* | |
| Usage of INET (Uses TSKEY environment variable) | |
| ... | |
| if ips := inet.Wait(context.Background()); len(ips) > 0 { | |
| log.Printf("connected to tailscale (ips=%v)", ips) | |
| } else { | |
| log.Printf("not connected to tailscale") | |
| } | |
| defer inet.Shutdown() |
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.
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.
This file contains hidden or 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
| defmodule Day3 do | |
| # Since my last answer wasn't purely Nx, I'm going | |
| # to try to stick to Nx as much as is possible, but | |
| # we don't have string manipulation stuff so that will | |
| # have to be done in Elixir | |
| import Nx.Defn | |
| def part1 do | |
| File.read!("aoc/3.txt") | |
| |> parse_input() |
This file contains hidden or 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
| ##-------------------------- | |
| ## Terraform: Functions ## | |
| ##-------------------------- | |
| ## Open terraform console | |
| terraform console | |
| ####################### | |
| ## Numeric Functions ## | |
| ####################### |
NewerOlder