Laur's blog
Sign in Subscribe

decorator

A collection of 2 posts
Scan Decorated Classes in Typescript
class

Scan Decorated Classes in Typescript

TL;DR: Make the decorator set a property in the class and look for it. While trying my hand at writing an ORM, I had a problem of initialising the database through a dummy instantiation of some models, without running an explicit command. In java, I can use code generation
Dec 21, 2016 1 min read
Braindump: Use a Decorator to Time your Python Function
decorator

Braindump: Use a Decorator to Time your Python Function

In the programs I write these days I use timing methods to profile the code, mainly because I find it easier to split and sum deltas based on functions. For example, I have a script that loads an XML file, parses it into a relational-ish layout, and uploads the layout
Jul 4, 2014 2 min read
Page 1 of 1
Laur's blog © 2025
  • Sign up
Powered by Ghost