Skip to content

Instantly share code, notes, and snippets.

View ksindi's full-sized avatar
🚀
Shipping

Kamil Sindi ksindi

🚀
Shipping
View GitHub Profile

Guidelines for API Design and Performance

Design Principles

Understanding HTTP Methods

  1. Clearly distinguish between POST, PATCH, and PUT to ensure proper usage and behavior in API interactions.

Endpoint Naming Conventions

@denguir
denguir / cuda_install.md
Last active July 5, 2024 07:35
Installation procedure for CUDA & cuDNN

How to install CUDA & cuDNN on Ubuntu 22.04

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

const awsTool = new DynamicTool({
name: "aws-cli",
description:
"This is AWS CLI. You can call this to send commands to the AWS Cloud. Use AWS CLI format like `aws s3api list-buckets`",
async func(command) {
const args = command.split(" ").filter((x) => x !== "aws");
const result = spawnSync("aws", args, {
env: {
...process.env,
AWS_REGION: "eu-central-1",
@domnikl
domnikl / build.yml
Last active June 22, 2024 11:55
GitHub Action Workflow to build a Rust project with tests and clippy
name: main
on:
push:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
@MRGRAVITY817
MRGRAVITY817 / main.rs
Last active June 21, 2022 02:58
State machine template built with Rust
use std::marker::PhantomData;
struct Reserved;
struct Cooking;
struct Delivering;
struct Arrived;
struct FoodDelivery<State = Reserved> {
state: PhantomData<State>,
}
@daniel-cortez-stevenson
daniel-cortez-stevenson / elasticsearch-service-template.yaml
Last active December 15, 2023 09:50
AWS ElasticSearch Domain with VPC and Bastion Cloudformation Template
# Copyright 2020 Daniel Cortez Stevenson
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@borischerkasky
borischerkasky / docker-compose.yml
Last active December 9, 2021 00:59
localstack docker compose
version: "3"
services:
localstack:
image: localstack/localstack
ports:
- "4568-4576:4568-4576"
- "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
environment:
- DOCKER_HOST=unix:///var/run/docker.sock
@miguelmota
miguelmota / csv_write.go
Last active August 18, 2023 16:16
Golang CSV write example
package main
import (
"encoding/csv"
"log"
"os"
)
func main() {
records := [][]string{

tldr: go build only produces an executable for main packages. Check the package name of your main file is main.

I am an idiot. Its only through mistakes that you learn tho. I have recently been running into issues with my new golang projects. ONLY the new ones. Whenever I try to make a new project, it would always have issues. The biggest issue is the fact that "go build" would not produce an executable without "-o main.exe" as arguments. When an executable was produced, if I ran it I got

$ ./main.exe
./main.exe: line 1: syntax error near unexpected token \`newline\'
./main.exe: line 1: \`!<arch>\'
package main
import (
"encoding/json"
"fmt"
)
func main() {
b := []byte(`{"key":"value"}`)