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 collections import Mapping | |
import unittest | |
import warnings | |
from flask import get_template_attribute | |
from myapplication import app | |
class JinjaTestCase(unittest.TestCase): |
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/sh | |
# Script for setting up virtualenv to work correctly with Google App Engine projects | |
# @author Karol Kuczmarski "Xion" | |
DEFAULT_APPENGINE_SDK_PATH="/opt/google_appengine" | |
DEFAULT_PROJECT_LIB_PATH="./lib" | |
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
""" | |
Example function that reads a file and does something with it. | |
""" | |
import re | |
import sys | |
def list_shell_aliases(script): | |
"""Find all command aliases defined in a shell script. | |
Aliases are created though the ``alias`` command:: |
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/sh | |
# Start a debug SMTP server using Python's smtpd module | |
show() { | |
echo 1>&2 "$@" | |
} | |
port=${1-25} | |
smtpd_args="-c DebuggingServer localhost:$port" |
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
def read_requirements(filename='requirements.txt'): | |
"""Reads the list of requirements from given file. | |
:param filename: Filename to read the requirements from. | |
Uses ``'requirements.txt'`` by default. | |
:return: Requirments as list of strings. | |
""" | |
# allow for some leeway with the argument | |
if not filename.startswith('requirements'): |
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/sh | |
# git-today | |
# | |
# Usage: | |
# * Name it `git-today` and put somewhere inside a `$PATH` directory | |
# * Invoke as $ git today | |
LAST_BEFORE_TODAY=$(git log --oneline --until='yesterday 23:59:59' | head -1 | cut -d' ' -f 1) | |
git --no-pager diff ${LAST_BEFORE_TODAY}..HEAD --stat |
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
#!/usr/bin/env runhaskell | |
-- Preview structured text files in the browser | |
-- Usage: $ preview FILE [BROWSER] | |
-- by Karol Kuczmarski "Xion" -- 25 August 2013 | |
import Control.Exception (bracket) | |
import System.Environment (getArgs) | |
import System.Directory (getTemporaryDirectory) |
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
package pl.org.xion.taphoo.logic; | |
/** | |
* An utility class to hold ranges of cells' values. | |
* @author Xion | |
*/ | |
final class CellRanges { | |
/** | |
* Private constructor to prevent instantiation. |
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
#!/usr/bin/env python | |
""" | |
{project} | |
====================================== | |
{description} | |
""" | |
import ast | |
import os | |
from setuptools import find_packages, setup |