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 | |
from line_profiler import LineProfiler | |
def profile(follow=[]): | |
def decorator(func): | |
@wraps(func) | |
def profiled_func(*args, **kwargs): | |
try: |
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
#!/bin/bash | |
# Get the container ID | |
container_id=$(docker ps -aqf "name=geo-django-1") | |
# If container is not running | |
if [ -z "$container_id" ]; then | |
echo "Container is not running." | |
exit 1 | |
fi |
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 rocker/r-ver:4.1.0 | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends apt-utils \ | |
default-jre \ | |
zlib1g-dev \ | |
libgit2-dev \ | |
libstdc++6 \ | |
libpng-dev \ | |
libxml2-dev \ |
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
SELECT | |
calls, | |
rows, | |
ROUND((total_time::numeric / 1000 / 60), 4) AS total_min, | |
-- newer versions of PostgreSQL have mean_exec_time field, don't need to calculate | |
--ROUND((total_exec_time / 1000 / calls)::numeric, 4) AS average_secs, | |
ROUND(mean_time::numeric / 1000 / 60, 4) AS average_min, | |
ROUND(min_time::numeric / 1000 / 60, 4) AS min_min, | |
ROUND(max_time::numeric / 1000 / 60, 4) AS max_min, | |
ROUND(stddev_time::numeric / 1000 / 60, 4) AS stddev_min, |
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
{ | |
description = "Flake to manage python environment"; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | |
mach-nix.url = "mach-nix/3.5.0"; | |
flake-utils.url = "github:numtide/flake-utils"; | |
}; | |
outputs = inputs@ { self, nixpkgs, mach-nix, flake-utils, ... }: |