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
#### Tie display strings | |
class OnTieBothDisplayed(object): | |
def tie_str(self): | |
return '{}-All'.format(self) | |
def __str__(self): | |
return self.__class__.__name__ |
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
.PHONY: tag | |
SHELL=bash | |
# assuming v0.1.0 is the only tag in the repo | |
tag: nr_of_existing_tags := $(shell git tag | grep "\<${TAG}\>" | wc -l) | |
tag: | |
@echo ${nr_of_existing_tags} | |
ifeq (1,$(nr_of_existing_tags)) | |
@echo tag ${TAG} already present ${nr_of_existing_tags} | |
else |
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 pytest | |
from django.core.cache import caches | |
@pytest.fixture() | |
def django_caches(): | |
yield caches | |
# finalizer | |
for cache in caches.all(): | |
cache.clear() |
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
default: &DEFAULT | |
URL: stooges.com | |
throw_pies?: true | |
stooges: &stooge_list | |
larry: first_stooge | |
moe: second_stooge | |
curly: third_stooge | |
development: | |
<<: *DEFAULT |
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 openpyxl.workbook import Workbook | |
from openpyxl.writer.excel import save_virtual_workbook, save_workbook | |
from openpyxl.reader.excel import load_workbook | |
from decimal import Decimal | |
import tempfile | |
import os | |
def get_filepath(name): | |
fh, path = tempfile.mkstemp(prefix=name, suffix='.xlsx') |
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
# -*- mode: ruby -*- | |
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox' | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provision "shell", path: "bootstrap.sh" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = true | |
vb.memory = "1024" |
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
Feature: Showing off behave | |
Scenario: Run a simple test | |
Given we have behave installed | |
When we implement 5 tests | |
Then behave will test them for us! |
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
mkdir vagrant-pytest-does-not-recogniz-pytest-django-on-ubuntu-trusty64 | |
cd vagrant-pytest-does-not-recogniz-pytest-django-on-ubuntu-trusty64 | |
vagrant init ubuntu/trusty64 | |
vagrant ssh |
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
$ elixir macros-why-error.exs | |
false | |
** (UndefinedFunctionError) undefined function: MyMacro.unless/2 | |
MyMacro.unless(false, [do: :ok]) | |
(elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/2 | |
(elixir) lib/code.ex:301: Code.require_file/2 |
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 assuming_sorted_input_with_callbacks(sorted_unique_integers, callback_to_invoke_on_each_consecutive_set): | |
""" context: | |
""" | |
if not sorted_unique_integers: | |
return # empty input | |
curr_lo = curr_hi = sorted_unique_integers[0] | |
for num in sorted_unique_integers[1:]: | |
if curr_hi != (num - 1): |
NewerOlder