Date: 2020-07-09
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
# Response to: | |
# http://blog.honeybadger.io/how-openstruct-and-hashes-can-kill-performance/ | |
# | |
# It's not faire to use `Hash.new.merge(data)` if you can `Hash[data]`. | |
# `Hash[data]` is way faster! Lets compare! | |
# | |
# Read more: http://ruby-doc.org/core-2.2.0/Hash.html#method-c-5B-5D | |
# | |
# [UPDATE] | |
# |
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
{ | |
"name": "phaser-types", | |
"author": "Manu Phatak", | |
"version": "3.18.1", | |
"types": "phaser.d.ts", | |
"peerDependency": { | |
"phaser": "3.18.1" | |
} | |
} |
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
{ | |
"name": "phaser-types", | |
"author": "Manu Phatak", | |
"version": "3.18.1", | |
"types": "./phaser.d.ts" | |
"peerDependency": { | |
"phaser": "3.18.1" | |
} | |
} |
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 | |
# coding=utf-8 | |
from __future__ import print_function | |
import json | |
import os.path | |
import shutil | |
import subprocess | |
import sys | |
from argparse import ArgumentParser, FileType |
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 functools import reduce | |
def pipeline(steps, initial=None): | |
def apply(result, step): | |
yield from step(result) | |
yield from reduce(apply, steps, initial) | |
if __name__ == '__main__': | |
# BEFORE |
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 setuptools import setup | |
from setuptools.command.test import test as TestCommand | |
class PyTest(TestCommand): | |
def finalize_options(self): | |
TestCommand.finalize_options(self) | |
self.test_args = [] | |
self.test_suite = True | |
def run_tests(self): |
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 functools import wraps | |
def defaults(method='__init__', **default_args): | |
"""Class decorator. Overrides method default arguments.""" | |
def decorate(cls): | |
func = getattr(cls, method) | |
@wraps(func) |
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
# Python Libraries | |
import re | |
# Django Packages | |
from django import template | |
register = template.Library() | |
_re_camel_humps = re.compile('([a-z])([A-Z0-9])') | |
""" |
NewerOlder