python random_connected_graph.py -p -g names.gml names.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Django LaTeX custom template tag for equations (using amsmath). | |
Creates a .png in the project media directory and returns an img tag that references it. | |
Usage: | |
{% latex %} | |
x=\frac{-b \pm \sqrt {b^2-4ac}}{2a} | |
{% endlatex %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ply.lex, argparse, io | |
# modified from https://gist.github.com/amerberg/a273ca1e579ab573b499 | |
#Usage | |
# python stripcomments.py input.tex > output.tex | |
# python stripcomments.py input.tex -e encoding > output.tex | |
# Modification: | |
# 1. Preserve "\n" at the end of line comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import numpy as np | |
from collections import Counter | |
def transport(supply, demand, costs, init_method="LCM"): | |
# Only solves balanced problem | |
assert sum(supply) == sum(demand) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
import django.core.mail | |
class MissingConnectionException(Exception): | |
pass | |
def get_connection(label=None, **kwargs): | |
if label is None: | |
label = getattr(settings, 'EMAIL_CONNECTION_DEFAULT', None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will help you setup Docker for TLS authentication. | |
# Run it passing in the arguement for the FQDN of your docker server | |
# | |
# For example: | |
# ./create-docker-tls.sh myhost.docker.com | |
# | |
# The script will also create a profile.d (if it exists) entry | |
# which configures your docker client to use TLS | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2010-2013 Samuel Sutch [[email protected]] | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |