Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "strings" | |
| "time" | |
| "golang.org/x/term" | |
| ) |
| module sysfetch | |
| go 1.23.2 |
| #!/bin/bash | |
| source <(go env) | |
| INFO=$(curl -sf 'https://go.dev/dl/?mode=json') | |
| [[ "$?" -ne "0" ]] && echo "Error getting latest info" && exit 1 | |
| FILEHASH=$(jq -r ".[0].files[] | select(.arch==\"$GOARCH\" and .os==\"$GOOS\") | \"\(.sha256) \(.filename)\"" <<< "$INFO") | |
| FILENAME=${FILEHASH#* } |
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| const ( | |
| numCols = 4 | |
| height = 32 | |
| width = 20 |
| CREATE TABLE IF NOT EXISTS cities ( | |
| id INTEGER PRIMARY KEY, | |
| name VARCHAR, | |
| uf_id INTEGER REFERENCES ufs (id) ON UPDATE RESTRICT ON DELETE RESTRICT, | |
| CONSTRAINT cities_name_uf_id_key UNIQUE (name, uf_id) | |
| ); | |
| ---- create above / drop below ---- | |
| DROP TABLE IF EXISTS cities; |
| { | |
| "name": "attach", | |
| "type": "go", | |
| "request": "attach", | |
| "mode": "remote", | |
| "remotePath": "/app", | |
| "port": 2345, | |
| "host": "localhost" | |
| } |
| DROP TABLE IF EXISTS items; | |
| DROP TABLE IF EXISTS categories; | |
| DROP TABLE IF EXISTS menus; |
| const express = require('express') | |
| const pug = require('pug') | |
| const app = express() | |
| const index = pug.compileFile('views/index.pug') | |
| app.get('/', (req, res) => { | |
| res.send(index({ title: 'Express' })) | |
| }) |
| const express = require('express') | |
| const app = express() | |
| app.set('view engine', 'pug') | |
| app.get('/', (req, res) => { | |
| res.render('index', { title: 'Express' }) | |
| }) |