Skip to content

Instantly share code, notes, and snippets.

View maartenterpstra's full-sized avatar

Maarten Terpstra maartenterpstra

View GitHub Profile
@maartenterpstra
maartenterpstra / solution.sql
Created December 16, 2019 13:53
Solution to SQL Murder Mystery
-- The solution to the murder mystery on https://mystery.knightlab.com/
-- The story:
-- A crime has taken place and the detective needs your help. The detective gave you the crime scene report, but you somehow lost it. You vaguely remember that the crime was a ​murder​ that occurred sometime on ​Jan.15, 2018​ and that it took place in ​SQL City​. Start by retrieving the corresponding crime scene report from the police department’s database.
SELECT description
FROM crime_scene_report
where date = 20180115 and city = 'SQL City' and type = 'murder';
-- Security footage shows that there were 2 witnesses.
-- The first witness lives at the last house on "Northwestern Dr".
@maartenterpstra
maartenterpstra / setup_jupyter.sh
Created July 25, 2024 08:21
Automatic Jupyter setup with kernel culling
#!/bin/bash
if [[ "$1" == "-h" ]]; then
echo "**Usage:** ./setup_jupyter.sh <environment> <port>"
echo ""
echo " environment (required): The name of the conda environment to create. Use base to only provide the configuration and conda is already set-up."
echo " port (required): The port number on which to run the Jupyter server (integer >= 5000)."
exit 0
fi