Skip to content

Instantly share code, notes, and snippets.

@martinarroyo
martinarroyo / getignore.py
Last active July 19, 2017 20:52
A simple downloader for .gitgnore files
#!/usr/bin/env python3
from urllib.request import Request, urlopen
from urllib.error import HTTPError
import sys, os
import argparse
url = "https://raw.githubusercontent.com/github/gitignore/master/{}.gitignore"
@martinarroyo
martinarroyo / citationneeded.tex
Created June 1, 2015 22:10
A LaTeX macro that sets a Wikipedia-stylized "Citation Needed" template and outputs the counter of references with a surprise. Use with write18 enabled! and the Figures directory in \graphicspath{}!
\newcounter{undefinedreferences}
\setcounter{undefinedreferences}{0}
\newcommand{\citationneeded}[1][None]{\stepcounter{undefinedreferences}\textsuperscript{\color{blue} [Citation needed: #1]}}
\newcommand{\checkreferences}{
\ifnum\value{undefinedreferences} > 0
\begin{center}
\immediate\write18{wget -O Figures/protester.png -nc http://imgs.xkcd.com/comics/wikipedian_protester.png}
\includegraphics[width=\textwidth]{protester.png}