Skip to content

Instantly share code, notes, and snippets.

@mprat
mprat / mathjax.html
Created Mar 19, 2017
Include for mathjax
View mathjax.html
<!-- Load mathjax -->
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<!-- MathJax configuration -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true,
processEnvironments: true
@mprat
mprat / jekyll.tpl
Last active Mar 19, 2017
nbconvert configuration for converting a Jupyter notebook into an HTML output with images saved separately, intended to be embedded into a Jekyll site.
View jekyll.tpl
{%- extends 'display_priority.tpl' -%}
{% block codecell %}
<div class="cell border-box-sizing code_cell rendered">
{{ super() }}
</div>
{%- endblock codecell %}
{% block input_group -%}
@mprat
mprat / upsert.py
Last active Dec 24, 2015 — forked from timtadh/upsert.py
How to compile an INSERT ... ON DUPLICATE KEY UPDATE with SQL Alchemy with support for a bulk insert.
View upsert.py
#!/usr/bin/env python
# Copyright (c) 2012, Tim Henderson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
View fixme.py
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------
# Copyright (c) 2013 - Damián Avila
#
# Distributed under the terms of the Modified BSD License.
#
# A little snippet to fix @media print issue printing slides from IPython
#-----------------------------------------------------------------------------
View scatter_plot_example
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View string_method_demo
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View full_data_analysis_example
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View csv_parse_example
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@mprat
mprat / high_school_education_system_with_clumps
Created Apr 26, 2013
A system diagram for secondary education at a high level, without any specifics.
View high_school_education_system_with_clumps
digraph high_school_sys{
overlap=scalexy;
nodesep=0.6;
subgraph cluster_after{
label = "After high school";
"College";
"Vocational career";
}
@mprat
mprat / school_test_infographic
Created Apr 26, 2013
A very simple GraphViz program to draw a very simple infographic sharing the message that education is not creative.
View school_test_infographic
digraph school_test{
label = "Where does the education happen?";
nodesep=1.2;
node [shape=box];
overlap=false;
"School" -> "Test";
"Test" -> "School";
}
And if it is saved as a .txt, .gv, whatever, then it can be compiled with: