Skip to content

Instantly share code, notes, and snippets.

View perebaj's full-sized avatar
🎯
Focusing

Jonathan perebaj

🎯
Focusing
View GitHub Profile
@saichenko
saichenko / conftest_alembic.py
Created October 14, 2021 19:38
Example of configuring a database with Alembic migrations using the 'pytest-async-sqlalchemy' lib
import asyncio
import pytest
from alembic.command import upgrade as alembic_upgrade
from alembic.config import Config as AlembicConfig
from pytest_async_sqlalchemy import create_database, drop_database
@pytest.fixture(scope="session")
def event_loop():
@jossef
jossef / force-delete-k8s-namespace.py
Created August 13, 2020 12:50
force delete k8s namespace
#!/usr/bin/env python3
import atexit
import json
import requests
import subprocess
import sys
namespace = sys.argv[1]
proxy_process = subprocess.Popen(['kubectl', 'proxy'])
atexit.register(proxy_process.kill)
@gagarine
gagarine / fish_install.md
Last active November 10, 2024 01:21
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@SLonger
SLonger / multipart_upload.go
Last active August 3, 2024 16:06 — forked from mattetti/multipart_upload.go
Example of doing a multipart upload in Go (golang) , client create http request instead of html form.
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@p4tin
p4tin / handlers_test.go
Created March 22, 2016 17:27
Testing Http Handlers in GO
package main
import (
"net/http"
"testing"
"net/http/httptest"
)
func TestHealthCheckHandler(t *testing.T) {
// Create a request to pass to our handler. We don't have any query parameters for now, so we'll