Skip to content

Instantly share code, notes, and snippets.


Daniel Roy Greenfeld pydanny

Block or report user

Report or block pydanny

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Usage: python
Tested on: Python 3.7 and 3.8
from sys import argv
from tempfile import NamedTemporaryFile
import re
import subprocess
import os
pydanny /
Last active Mar 21, 2018
How mountain will work

First, get the template, which will include a module.

cookiecutter gh:pydanny/mountain

Second, get the package that includes dependencies like Flask, markdown2, etc

cd <project-name>
from glob import glob
def erase_lines_in_files(directory):
for filename in glob(f"{directory}*.csv"):
with open(filename, "rb") as f:
lines = f.readlines()
for line in lines[1:]:
View gist:67d1b7c03a64b2bc8bea73525b7677f7
$ python sdist upload
running sdist
running egg_info
writing arepa.egg-info/PKG-INFO
writing dependency_links to arepa.egg-info/dependency_links.txt
writing top-level names to arepa.egg-info/top_level.txt
reading manifest file 'arepa.egg-info/SOURCES.txt'
reading manifest template ''
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no files found matching '*.jpg' under directory 'docs'
pydanny / failing_image_example.rst_
Last active Jan 26, 2018
How I convert rst to HTML. Currently fails on images.
View failing_image_example.rst_
This image fails when I run it via the function below:
.. image::
:align: center
:alt: BitCoin and Two Scoops of Django!
Error provided is::
<h1>System Message: ERROR/3 (&lt;string&gt; line 4)</h1>
pydanny /
Last active Dec 12, 2018
running local unverified SSL on Django and Flask (don't do this in production!!!)
from .common import * # noqa
DEBUG = True
INSTALLED_APPS += ('django_extensions',)
# Snip all the other stuff
pydanny / gist:93b1cf17d9573136dcc15d6d6bb8cd0c
Last active Apr 27, 2017
Pelican crash message that gives me nothing useful to work on
View gist:93b1cf17d9573136dcc15d6d6bb8cd0c
CRITICAL: RuntimeError: File blog/ is to be overwritten
View Makefile
xelatex -shell-escape coloringbook.tex
rm *aux; rm *idx; rm *log; rm *out; rm *thm;
open coloringbook.pdf
View fontspec_error.tex
% Our tocloft configuration
\newlength{\mylen} %% extra space
\addtolength{\cftsecnumwidth}{\mylen} % add the extra space after section numbers
\addtolength{\cftsubsecnumwidth}{\mylen} % add the extra space after subsection numbers
% How we load fontspec
View megaref.tex
\hyperref[#1]{\Cref{#1}: \nameref{#1}}
You can’t perform that action at this time.