There are two types of markup in Liquid: Output and Tag.
- Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}- Tag markup (which cannot resolve to text) is surrounded by
| import subprocess | |
| import sys | |
| def convert(source, from_format, to_format): | |
| # original version: http://osiux.com/html-to-restructured-text-in-python-using-pandoc | |
| # supported formats at http://johnmacfarlane.net/pandoc/ | |
| # raises OSError if pandoc is not found! | |
| p = subprocess.Popen(['pandoc', '--from=' + from_format, '--to=' + to_format], | |
| stdin=subprocess.PIPE, stdout=subprocess.PIPE | |
| ) |
| /* | |
| * I add this to html files generated with pandoc. | |
| */ | |
| html { | |
| font-size: 100%; | |
| overflow-y: scroll; | |
| -webkit-text-size-adjust: 100%; | |
| -ms-text-size-adjust: 100%; | |
| } |
| scale_x_discrete(limits = rev(levels(the_factor))) |
| """ Quick example showing how to do a bulk update into the database | |
| using SQLAlchemy, without interacting heavily with the ORM. | |
| """ | |
| from sqlalchemy.sql.expression import bindparam | |
| stmt = addresses.update().\ | |
| where(addresses.c.id == bindparam('_id')).\ | |
| values({ | |
| 'user_id': bindparam('user_id'), | |
| 'email_address': bindparam('email_address'), |
There are two types of markup in Liquid: Output and Tag.
{{ matched pairs of curly brackets (ie, braces) }}
| /* | |
| * I add this to html files generated with pandoc. | |
| */ | |
| html { | |
| font-size: 100%; | |
| overflow-y: scroll; | |
| -webkit-text-size-adjust: 100%; | |
| -ms-text-size-adjust: 100%; | |
| } |
| def custom_cmap(colors, padding=1.05): | |
| """ Create a custom colormap from a dictionary | |
| Args: | |
| colors <dict>: Levels to colornames | |
| padding <float>: Offset levels | |
| """ | |
| assert(isinstance(colors, dict)) | |
| assert(None in colors) |
| # Gnome 3 - based on https://blog.samalik.com/make-your-gnome-title-bars-smaller/ | |
| .header-bar.default-decoration { | |
| padding-top: 3px; | |
| padding-bottom: 3px; | |
| font-size: 0.8em; | |
| } | |
| .header-bar.default-decoration .button.titlebutton { | |
| padding: 0px; | |
| } |
| import networkx as nx | |
| import matplotlib.pyplot as plt | |
| import matplotlib.image as mpimg | |
| import glob | |
| from numpy import sqrt | |
| import glob | |
| path = '' | |
| files = [f for f in glob.glob(path + "*.jpg")] | |
| img = [] |