Skip to content

Instantly share code, notes, and snippets.

@chad-m
chad-m / streamlit_download_button.py
Last active April 1, 2024 02:28
A download function and examples app for Streamlit
import base64
import os
import json
import pickle
import uuid
import re
import streamlit as st
import pandas as pd
@matthiassb
matthiassb / dns-sync.sh
Last active March 20, 2024 12:12
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@n-s-k
n-s-k / OOP_F2003_Part_1.md
Last active May 10, 2024 13:46
Object-Oriented Programming in Fortran 2003 Part 1: Code Reusability
@lmyyao
lmyyao / sqlalchemy_bind_two_database.py
Created September 14, 2016 06:39
sqlalchemy bind multiple databases
from sqlalchemy import (String,
Integer,
engine_from_config,
Column)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base_1 = declarative_base()
Base_2 = declarative_base()
@evantoli
evantoli / GitConfigHttpProxy.md
Last active May 20, 2024 08:42
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@patriciogonzalezvivo
patriciogonzalezvivo / PythonSetup.md
Created October 7, 2014 23:17
How to install Python correctly on Mac OSX

Install Homebrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Add PATH to ~/.bash_profile and ~/.zshrc

export PATH=/usr/local/bin:$PATH
@qur2
qur2 / xfocus.py
Created June 7, 2013 12:58
Python + AppleScript to bring a window in foreground.
# Using applescript, sets the focus + foreground on a window by its title
# That works on OSX 10.7.5.
# @author Aurelien Scoubeau <aurelien.scoubeau@gmail.com>
import argparse
import subprocess
parser = argparse.ArgumentParser(description='Utility to activate a window by title, for OSX')
parser.add_argument('title', help='Title of the window to activate')
args = vars(parser.parse_args())