Skip to content

Instantly share code, notes, and snippets.

View tvogels's full-sized avatar

Thijs Vogels tvogels

  • Microsoft Research
  • Amsterdam
View GitHub Profile
// this is a locale bundle
var locale = {"en-US":"<locale xml:lang=\"en\" xmlns=\"http://purl.org/net/xbiblio/csl\"> <style-options punctuation-in-quote=\"true\"/> <date form=\"text\"> <date-part name=\"month\" suffix=\" \"/> <date-part name=\"day\" suffix=\", \"/> <date-part name=\"year\"/> </date> <date form=\"numeric\"> <date-part name=\"year\"/> <date-part name=\"month\" form=\"numeric\" prefix=\"-\" range-delimiter=\"/\"/> <date-part name=\"day\" prefix=\"-\" range-delimiter=\"/\"/> </date> <terms> <term name=\"document-number-label\">No.</term> <term name=\"document-number-authority-suffix\">Doc.</term> <term name=\"un-sales-number-label\">U.N. Sales No.</term> <term name=\"collection-number-label\">No.</term> <term name=\"open-quote\">\u201c</term> <term name=\"close-quote\">\u201d</term> <term name=\"open-inner-quote\">\u2018</term> <term name=\"close-inner-quote\">\u2019</term> <term name=\"ordinal-01\">st</term> <term name=\"ordinal-02\">nd</ter
@robert2d
robert2d / bash-cli-openssl-stdin-encryption
Last active June 13, 2024 05:30
Bash $STDIN Encryption with openssl and aes256
# Encrypt STDIN and provide a password(prompt)
echo "message" | openssl enc -aes-256-cbc -a
# Decrypt STDIN and provide a password(prompt)
echo "encrypted" | openssl enc -aes-256-cbc -a -d
@jeremyschlatter
jeremyschlatter / Jupyter-React-integration.ipynb
Created July 25, 2017 02:36
Render React inline from a Jupyter notebook cell
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gmarull
gmarull / example-tex2svg.py
Last active September 21, 2023 01:56
Render TeX to SVG in Python using matplotlib and display with PyQt
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtSvg import QSvgWidget
from io import BytesIO
import matplotlib.pyplot as plt
# matplotlib: force computer modern font set
plt.rc('mathtext', fontset='cm')
@thomasballinger
thomasballinger / cell_invalidation.ipynb
Created February 1, 2020 08:15
sketch of noticing that a cell has been removed or reexecuted. Useful for stopping timers, removing event listeners, etc.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jbcdnr
jbcdnr / recorder.py
Last active February 19, 2021 09:58
Record input and output of any PyTorch layer
"""
# Quick start
wget -O recorder.py https://gist.github.com/jbcdnr/50d416dec405d88f576ba497c418b04e/raw/
# Small example
from recorder import trace_layers
import torchvision
resnet = torchvision.models.resnet18()
with trace_layers(resnet, "layer1[0].conv1", "layer1[0].conv2") as recorded_values: