Skip to content

Instantly share code, notes, and snippets.

View Edmartt's full-sized avatar
💭
Looking for knowledge

Edmartt Edmartt

💭
Looking for knowledge
View GitHub Profile
@Edmartt
Edmartt / linkedList.c
Created December 27, 2023 08:30
Linked List in C
#include <stdio.h>
#include <stdlib.h>
struct Node{
int data;
struct Node* next;
};
typedef struct Node node;
@Edmartt
Edmartt / linked_list.py
Last active December 27, 2023 20:20
Linked Lists in Python OOP version
class Node:
def __init__(self, data: int, next=None):
self.data = data
self.next = next
class LinkedList:
def add_elements(self, init_node: Node, data: int):
new_node = Node(data=data, next=None) # new node with the data and next reference
@Edmartt
Edmartt / multiprocess.py
Created December 20, 2023 08:16
Python Concurrency and Parallelism
"""
This tiny test is the difference between concurrence and parallelism in Python.
With the multiprocessing module we have real access to parallelism always that we have more than one CPU core
"""
import os
from random import randint
from multiprocessing import Process
import time
@Edmartt
Edmartt / threads.py
Last active December 20, 2023 08:24
python threads
"""This tiny test is for learning some uses of concurrency in Python.
The Threading module just creates one unique process even when you have n CPU cores, so, when you launch threads, these are just subprocess of the first process.
"""
import os
import random
from threading import Thread
import time
@Edmartt
Edmartt / gostart.sh
Created July 12, 2023 20:53
script for getting my go projects started with a basic structure
read -p 'Type the main directory project: ' dir_name
mkdir $dir_name && cd $dir_name
echo Starting the base structure for the project...
sleep 1
read -p 'type the project name: ' project_name
read -p 'type your github username: ' github_username
@Edmartt
Edmartt / export-kubeconfig-from-aks
Created May 12, 2023 14:43 — forked from dcasati/export-kubeconfig-from-aks
Export KUBECONFIG from AKS
az aks get-credentials --resource-group k8s-demo-ss --name k8s-demo-cluster-ss --file kubeconfig-ss
@Edmartt
Edmartt / file-upload-multipart.go
Created January 28, 2023 01:58 — forked from andrewmilson/file-upload-multipart.go
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"
@Edmartt
Edmartt / docker-volumes.md
Created April 23, 2022 23:23 — forked from onlyphantom/docker-volumes.md
Demystifying Docker Volumes for Mac and PC Users

Demystifying Docker Volumes for Mac and PC Users

  1. Docker runs on a Linux kernel

Docker can be confusing to PC and Windows users because many tutorials on that topic assume you're using a Linux machine.

As a Linux user, you learn that Volumes are stored in a part of the host filesystem managed by Docker, and that is /var/lib/docker/volumes. When you're running Docker on a Windows or Mac OS machine, you will read the same documentation and instructions but feel frustrated as that path don't exist on your system. This simple note is my answer to that.

When you use Docker on a Windows PC, you're typically doing one of these two things:

  • Run Linux containers in a full Linux VM (what Docker typically does today)
@Edmartt
Edmartt / zshrc
Created December 25, 2021 09:15 — forked from LukeSmithxyz/zshrc
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history

Keybase proof

I hereby claim:

  • I am edmartt on github.
  • I am edmartt (https://keybase.io/edmartt) on keybase.
  • I have a public key ASCBFG5PJ202fo5DvaKAOUqMQMOsY_8Mi0k_8y1IZhhUYQo

To claim this, I am signing this object: