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 argparse | |
import ast | |
import io | |
from Cheetah.compile import compile_source | |
from Cheetah.Template import Template | |
template_self_vars = {var for var in dir(Template) if not var.startswith('_')} |
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
// ---- | |
// Sass (v3.4.20) | |
// Compass (v1.0.3) | |
// ---- | |
a, b { | |
&:not(c) { | |
d: e; | |
} | |
} |
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 random | |
import re | |
simple_word_regex = re.compile('^[a-z]+$') | |
word_list = [] | |
with open('/usr/share/dict/american-english', 'r') as words_file: | |
for word_line in words_file: | |
word = word_line.strip() |
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 contextlib | |
import collections | |
import mock | |
import sys | |
def fake_module(**args): | |
return (collections.namedtuple('module', args.keys())(**args)) | |
def get_patch_dict(dotted_module_path, module): | |
patch_dict = {} |
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
#include <iostream> | |
using std::cout; | |
using std::endl; | |
class Range { | |
public: | |
explicit Range(int endValue) : start(0), endValue(endValue) { } | |
Range(int start, int endValue) : start(start), endValue(endValue) { } |
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
#ifndef GHETTO_RETRY_H | |
#define GHETTO_RETRY_H | |
template<typename TEx, TCall> | |
void ghettoRetry(TCall call, int count = 1) { | |
// Retry count number of times | |
// Note the last one will throw on failure | |
for (int i = 0; i < count - 1; i += 1) { | |
try { | |
call(); |
NewerOlder