This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| # brew install unixodbc | |
| export CPPFLAGS="-I/opt/homebrew/Cellar/unixodbc/2.3.9_1/include" | |
| export LDFLAGS="-L/opt/homebrew/Cellar/unixodbc/2.3.9_1/lib -liodbc -liodbcinst" | |
| export PKG_CONFIG_PATH="/opt/homebrew/Cellar/unixodbc/2.3.9_1/lib/pkgconfig $PKG_CONFIG_PATH" | |
| pip install --no-binary pyodbc pyodbc |
| # ========= PROMPT ========= | |
| # Version control information | |
| autoload -Uz vcs_info | |
| precmd() { vcs_info } | |
| # Format the vcs_info_msg_0_ variable | |
| zstyle ':vcs_info:git:*' formats ' %b ' | |
| # Render the prompt | |
| setopt PROMPT_SUBST |
| # Based on https://gist.github.com/kmatt/71603170556ef8ffd14984af77ff10c5 | |
| # prompt ">" indicates Powershell commands | |
| # prompt "$" are Linux shell commands | |
| # https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
| > dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
| > dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
| # install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi |
| " Maintainer: Lars Nielsen (dengmao@gmail.com) | |
| " Last Change: January 22 2007 | |
| " https://dengmao.wordpress.com/2007/01/22/vim-color-scheme-wombat/ | |
| set background=dark | |
| hi clear | |
| if exists("syntax_on") | |
| syntax reset |
| # This will likely become unneeded with https://fedoraproject.org/wiki/Changes/FedoraWSL | |
| ## From https://fedoramagazine.org/wsl-fedora-33/ | |
| ## prompt ">" indicates Powershell commands | |
| # https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
| > dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
| > dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| /* | |
| ClickHouse client version 1.1.53996. | |
| Connecting to localhost:9000. | |
| Connected to ClickHouse server version 1.1.53996. | |
| */ | |
| :) CREATE TABLE IF NOT EXISTS `employee` ( | |
| :-] `empid` Int32, | |
| :-] `deptid` Int32, | |
| :-] `salary` Int64 |
| import pandas as pd | |
| import visidata as vd | |
| df=pd.read_csv('file.csv') | |
| vd.view_pandas(df) |
| -- original source: https://medium.com/adhawk-engineering/using-postgresql-to-generate-slugs-5ec9dd759e88 | |
| -- https://www.postgresql.org/docs/9.6/unaccent.html | |
| CREATE EXTENSION IF NOT EXISTS unaccent; | |
| CREATE OR REPLACE FUNCTION public.slugify(v TEXT) RETURNS TEXT | |
| LANGUAGE plpgsql | |
| STRICT IMMUTABLE AS | |
| $function$ | |
| BEGIN |
| create or replace function create_jsonb_flat_view | |
| (table_name text, regular_columns text, json_column text) | |
| returns text language plpgsql as $$ | |
| declare | |
| cols text; | |
| begin | |
| execute format ($ex$ | |
| select string_agg(format('%2$s->>%%1$L "%%1$s"', key), ', ') | |
| from ( | |
| select distinct key |