Skip to content

Instantly share code, notes, and snippets.

@vidakDK
vidakDK / pycurl.md
Last active November 2, 2023 03:06
Install `pycurl` on MacOS Big Sur 11.0.1

Introduction

Installing pycurl on MacOS with Python 3.6+ and newer proved to be tricky, especially since a lot of the available resources seem to be outdated ([1], [2], [3]).

This gist was last updated at 2020-12-31.

Steps:

  1. Remove previously installed Homebrew versions of curl:
    brew uninstall curl
@marta-sd
marta-sd / tf_merge.py
Last active February 10, 2022 10:08
Merge two models in TensorFlow
import tensorflow as tf
# 1. Create and save two graphs
# c = a*b
g1 = tf.Graph()
with g1.as_default():
a = tf.placeholder(tf.float32, name='a')
b = tf.Variable(initial_value=tf.truncated_normal((1,)), name='b')
@SalemHarrache
SalemHarrache / remove_foreign_keys.py
Created January 22, 2015 14:44
SQLAlchemy : remove all foreign keys constraints
def remove_foreign_keys(db):
log("Dropping all foreign key constraints from archive database")
inspector = reflection.Inspector.from_engine(db.engine)
fake_metadata = MetaData()
fake_tables = []
all_fks = []
for table_name in db.metadata.tables: