Skip to content

Instantly share code, notes, and snippets.

View tommyip's full-sized avatar

Thomas Ip tommyip

View GitHub Profile
@tommyip
tommyip / blog_latex_title.tex
Last active September 18, 2017 08:56
LaTeX title for single page documents
\title{\vspace{-2cm}Writing single page documents in \LaTeX}
\author{Author name}
\begin{document}
\maketitle
\end{document}
@tommyip
tommyip / in_nD_list.py
Last active November 2, 2016 21:14
Check if element is in a non-uniform N-d Python list [Python]
def in_nD_list(search_list, key):
for element in search_list:
if isinstance(element, str):
if key in element:
break
else:
if in_nD_list(element, key):
break
else:
return False
@tommyip
tommyip / fizzbuzz.erl
Created August 9, 2016 11:16
FizzBuzz test with no conditional statement in Erlang
-module(fizzbuzz).
-export([fizzbuzz/0]).
fizzbuzz() -> N = 1, fizzbuzz({N rem 3, N rem 5, N}).
fizzbuzz({N3, N5, N}) when N =< 100 ->
case {N3, N5, N} of
{0, 0, _} -> io:format("FizzBuzz~n");
{0, _, _} -> io:format("Fizz~n");
{_, 0, _} -> io:format("Buzz~n");