Skip to content

Instantly share code, notes, and snippets.

View mkenne11's full-sized avatar

Michael Kennedy mkenne11

  • @home
  • Canberra, Australia
  • 19:49 (UTC +10:00)
View GitHub Profile
@mkenne11
mkenne11 / Upgrade OpenWRT Packages
Last active April 18, 2020 05:52
Upgrade OpenWRT Packages
opkg update
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
npm install ajv @types/ajv --save-dev
## Step 1. Setup VSCode project build and debug configuration.
Under the `.vscode` folder create 'launch.json` and 'tasks.json` files. The contents of both files is shown below.
a. launch.json
```
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
@mkenne11
mkenne11 / gist:f6ab4e24463b0e3bed46
Last active August 29, 2015 14:23
Function timing decorator
# Based on code sample at: http://www.marinamele.com/7-tips-to-time-python-scripts-and-control-memory-and-cpu-usage
# Decorator "fn_timer" which times a function and has argument "class-name".
def fn_timer(class_name):
def _fn_timer(function):
@wraps(function)
def function_timer(*args, **kwargs):
t0 = time.time()
result = function(*args, **kwargs)
t1 = time.time()