Skip to content

Instantly share code, notes, and snippets.

@timvieira
timvieira / make-wrapper.bash
Created November 19, 2016 19:38
Make wrapper - Guesses what I meant when there was no Makefile in the current directory.
function yellow { echo -e "\e[33m$@\e[0m"; }
# Wrapper around make, which covers building different project types, when an
# actual Makefile isn't present.
function make {
if [[ -e Makefile ]]; then
yellow "[make] found Makefile"
/usr/bin/make $@
else
yellow "[make] No Makefile found"
@timvieira
timvieira / reverse.py
Last active January 16, 2018 17:26
Reversing a singly-linked sequence defined by a function application with sublinear space.
# -*- coding: utf-8 -*-
"""
Reversing a singly-linked sequence defined by a function application in
sublinear space.
s[t] = f(s[t-1]) where s[0] is given as input.
Code associated with blog post
"Reversing a sequence with sublinear space"
http://timvieira.github.io/blog/post/2016/10/01/reversing-a-sequence-with-sublinear-space/
import numpy as np
import pylab as pl
from numpy import exp, cos, sin, sqrt
from arsenal.math import compare
def run_tests():
tests = """
x**2
2*x