Skip to content

Instantly share code, notes, and snippets.

View mikkelam's full-sized avatar
🍌
banana

Mikkel A. Madsen mikkelam

🍌
banana
View GitHub Profile
@finagin
finagin / socks5.sh
Last active September 29, 2021 12:23
#!/usr/bin/env bash
SUDO=''
if [ "$(id -u)" != "0" ]; then
SUDO='sudo'
echo "This script requires superuser access."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
fi
@rxwei
rxwei / ad-manifesto.md
Last active November 9, 2023 09:58
First-Class Automatic Differentiation in Swift: A Manifesto
@andres-torres-marroquin
andres-torres-marroquin / 1-Hackintosh.md
Last active July 19, 2019 23:46
Hackintosh ROG Strix Z270I macOS Sierra 10.12.6
@h4
h4 / env.py
Last active March 13, 2024 07:22
Setup alembic to work properly with PostgreSQL schemas
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from models import Base
config = context.config
fileConfig(config.config_file_name)
@mikkelam
mikkelam / sklearn_vw.py
Created March 30, 2016 16:34
Extends vowpals sklearn interface to ect with multiclass classification
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long, unused-argument, invalid-name, too-many-arguments, too-many-locals
"""
Utilities to support integration of Vowpal Wabbit and scikit-learn
"""
import numpy as np
import sklearn
from pyvw import vw
import re
@mikkelam
mikkelam / hamilton.py
Last active October 29, 2022 07:21
Finds a hamiltonian path using networkx graph library in Python with a backtrack solution
import networkx as nx
def hamilton(G):
F = [(G,[list(G.nodes())[0]])]
n = G.number_of_nodes()
while F:
graph,path = F.pop()
confs = []
neighbors = (node for node in graph.neighbors(path[-1])
if node != path[-1]) #exclude self loops