Skip to content

Instantly share code, notes, and snippets.

@vidakDK
vidakDK / look_and_say.py
Created June 3, 2021 17:53
Length of n-th look-and-say number
"""
Script to calculate 'look-and-say' sequence numbers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Started off with good old `for` loops but wanted to have fun with some
functional programming recipes and play some code golf :)
"""
import functools as _ft
import itertools as _it
@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
@vidakDK
vidakDK / tf_merge.py
Created November 7, 2018 15:36 — forked from marta-sd/tf_merge.py
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')