This file contains 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
module sysfetch | |
go 1.23.2 |
This file contains 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
#!/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#* } |
This file contains 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
package main | |
import ( | |
"fmt" | |
) | |
const ( | |
numCols = 4 | |
height = 32 | |
width = 20 |
This file contains 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
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; |
This file contains 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
{ | |
"name": "attach", | |
"type": "go", | |
"request": "attach", | |
"mode": "remote", | |
"remotePath": "/app", | |
"port": 2345, | |
"host": "localhost" | |
} |
This file contains 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
DROP TABLE IF EXISTS items; | |
DROP TABLE IF EXISTS categories; | |
DROP TABLE IF EXISTS menus; |
This file contains 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
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' })) | |
}) |
This file contains 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
const express = require('express') | |
const app = express() | |
app.set('view engine', 'pug') | |
app.get('/', (req, res) => { | |
res.render('index', { title: 'Express' }) | |
}) |
This file contains 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
const net = require('net') | |
const server = net.createServer((socket) => { | |
const IP = socket.remoteAddress | |
socket.on('data', (data) => { | |
process.stdout.write(data.toString()) | |
}) | |
socket.on('end', () => { |
This file contains 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
// (Really Simple) PID Class by Ivan Seidel | |
// GitHub.com/ivanseidel | |
// Use as you want. Leave credits | |
class PID{ | |
public: | |
double error; | |
double sample; | |
double lastSample; |
NewerOlder