This file contains hidden or 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
class MyOtherClass(object): | |
def do_something(self): | |
self.__do_a_new_step() | |
self.__do_one_more_step() | |
# Should be subclassing from MyClass | |
class MyOtherClass(MyClass): | |
def do_something(self): | |
self.__do_a_new_step() | |
self.__do_one_more_step() |
This file contains hidden or 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 -*- | |
""" | |
github3.licenses | |
================ | |
This module contains the classes relating to licenses | |
See also: https://developer.github.com/v3/licenses/ | |
""" | |
from __future__ import unicode_literals |
This file contains hidden or 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
[program:uwsgi-{{ project }}-{{ env }}] | |
command={% if new_relic_enabled %}{{ env_folder }}/bin/newrelic-admin run-program {% endif %}{{ env_folder }}/bin/uwsgi --ini {{ env_folder }}/uwsgi.ini | |
autostart=true | |
startsecs=10 | |
stopwaitsecs=35 | |
redirect_stderr=true | |
stopsignal=QUIT | |
environment=CELERY_LOADER='django',DJANGO_SETTINGS_CHAIN='www',NEW_RELIC_CONFIG_FILE='/etc/newrelic/new-relic-{{ project }}-{{ env }}-www.ini' | |
stdout_logfile=/var/log/supervisor/uwsgi-{{ project }}-{{ env }}.log | |
stderr_logfile=/var/log/supervisor/uwsgi-{{ project }}-{{ env }}-stderr.log |
This file contains hidden or 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
(github3)Matts-Air:github3.py mattchung$ wc -l tests/*.py | sort | |
0 tests/__init__.py | |
17 tests/nbtest.py | |
17 tests/test_github.py | |
22 tests/fixtures.py | |
44 tests/conftest.py | |
79 tests/test_structs.py | |
127 tests/utils.py | |
430 tests/test_repos.py | |
736 total |
This file contains hidden or 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 tempfile | |
import mock | |
def use_tempfile(): | |
dest_dir = '/tmp' | |
with tempfile.NamedTemporaryFile(dir=dest_dir, delete=False) as temp_dest: | |
print "hello world" | |
return temp_dest | |
@mock.patch.object(tempfile, 'NamedTemporaryFile') | |
def call_use_tempfile(temp_file): |
This file contains hidden or 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
# this goes in diplomatico | |
PROOF_API_BASE_URL = {{ proof_base_url[env] }} | |
# group_vars/all | |
proof_base_url: | |
qa: 'https://proof-qa.whalerockengineering.com' | |
production: 'https://proof.whalerockengineering.com' |
This file contains hidden or 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
PROJECT = sample-python-app | |
FUNCTION = $(PROJECT) | |
REGION = us-east-1 | |
.phony: clean | |
clean: | |
rm -f -r $(FUNCTION)* | |
rm -f -r site-packages |
This file contains hidden or 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
main.py | |
netstorage/ | |
netstorage/__init__.py | |
... | |
requests/ | |
requests/__init__.py | |
... |
This file contains hidden or 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 dsandalgs; | |
public class Deque<E> { | |
int INIT_QUEUE_SIZE = 8; | |
int first = 0; | |
int size = 0; | |
E[] queue; | |
public Deque(){ | |
this.queue = (E[]) new Object[this.INIT_QUEUE_SIZE]; |
This file contains hidden or 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
// This file is part of www.nand2tetris.org | |
// and the book "The Elements of Computing Systems" | |
// by Nisan and Schocken, MIT Press. | |
// File name: projects/01/DMux.hdl | |
/** | |
* Demultiplexor: | |
* {a, b} = {in, 0} if sel == 0 | |
* {0, in} if sel == 1 | |
*/ |