Skip to content

Instantly share code, notes, and snippets.

View laowantong's full-sized avatar

Aristide laowantong

  • Université de Lorraine
  • Metz, France
View GitHub Profile
@parente
parente / code_toggle.js
Last active August 6, 2022 21:03
Code toggle for notebooks on nbviewer
// Builds on http://chris-said.io/2016/02/13/how-to-make-polished-jupyter-presentations-with-optional-code-visibility/
// to inject a navbar button in the nbviewer UI and to make the snippet easily reusable across notebooks, i.e.:
// %%html
// <script src="https://cdn.rawgit.com/parente/4c3e6936d0d7a46fd071/raw/2af9515fbe8b776bf8e1c41d8dc662146993bd0d/code_toggle.js"></script>
$(document).ready(function(){
function onShow() {
$('div.input').show(100, function() {
$('div.cell').css({padding: '5px', border: '1px'});
});
}
@GenevieveBuckley
GenevieveBuckley / test_monkeypatch.py
Last active December 12, 2023 18:57
Monkeypatching user input with pytest
from io import StringIO
def double():
x = input("Enter an integer: ")
return int(x) * 2
def adding():
x = float(input('Enter the first number'))
@bearloga
bearloga / sql-murder-mystery-solution.md
Created October 13, 2019 01:42
A walkthrough of the solution to SQL Murder Mystery by Northwestern University Knight Lab. Solution by Mikhail Popov (@bearloga)

Solution to SQL Murdery Mystery

A walkthrough of the solution to SQL Murder Mystery by Northwestern University Knight Lab. Solution by Mikhail Popov

Prompt

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.

Witness reports