Skip to content

Instantly share code, notes, and snippets.

@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@jauderho
jauderho / gist:6b7d42030e264a135450ecc0ba521bd8
Last active May 7, 2024 21:09
HOWTO: Upgrade Raspberry Pi OS from Bullseye to Bookworm
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Officially, this is not recommended. YMMV
# https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/
#
# This mostly works if you are on 64bit. You are on your own if you are on 32bit or mixed 64/32bit
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#
@Mattemagikern
Mattemagikern / Certificates.go
Created May 9, 2019 08:31
Create x509 certificate chain using Golang. Root CA, Designated CA, server CA
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
@renomureza
renomureza / list-online-gaming-ports-for-mikrotik.txt
Created April 21, 2021 17:01
List of online gaming ports that can be used to optimize the RouterOS Mikrotik router connection
Mobile Legend (ML)
tcp: 5000-5221,5224-5227,5229-5241,5243-5508,5551-5559,5601-5700,9001,9443
tcp: 10003,30000-30300
udp: 4001-4009,5000-5221,5224-5241,5243-5508,5551-5559,5601-5700
udp: 2702,3702,8001,9000-9010,9992,10003,30190,30000-30300
Free Fire (FF)
tcp: 6006,6674,7006,7889,8001-8012,9006,10000-10012,11000-11019,120006,12008,13006
tcp: 39003,39006,39698,39779,39800
udp: 6006,6008,7008,8008,9008,10000-10013,10100,11000-11019,12008,13008
@abidanBrito
abidanBrito / build-emacs.sh
Last active May 7, 2024 21:05
Build GNU Emacs from source.
#!/usr/bin/env bash
## Author: Abidán Brito
## This script builds GNU Emacs 29.1 with support for native elisp compilation,
## tree-sitter, libjansson (C JSON library), pure GTK and mailutils.
# Exit on error and print out commands before executing them.
set -euxo pipefail
# Let's set the number of jobs to something reasonable; keep 2 cores
@justinmklam
justinmklam / python-paths-and-imports.md
Last active May 7, 2024 21:05
Techniques for python path manipulation and relative imports in (i.e. when not dealing with a package).

Paths

import os

# To get the directory of the script/file:
current_dir = os.path.dirname(os.path.realpath(__file__))

# To get one directory up from the current file
parent_dir = os.path.abspath(os.path.join(current_dir, ".."))
@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 21:05
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@rain-1
rain-1 / llama-home.md
Last active May 7, 2024 21:04
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@rxaviers
rxaviers / gist:7360908
Last active May 7, 2024 21:01
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@maguero
maguero / setting-multiple-git-accounts.md
Last active May 7, 2024 21:00
Setting multiple Github accounts on MacOS

Setting multiple Github accounts on MacOS

There are some cases on which an engineer need to setup more than one GitHub account on the local env, like a personal and profesional accounts. This post goal is to guide on setting 2 accounts, the default one (let's say your personal) and another one (probably a professional) by setting these on the shh config file.

Let's assume you already have your personal account setup and working. Now it's time to setup the addional account:

1 - Create a new ssh key for your 2nd GitHub account

Follow Generating a new SSH key document in order to generate a new SSH key on your local machine for your 2nd account.

[!NOTE]