start new:
tmux
start new with session name:
tmux new -s myname
// 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'}); | |
}); | |
} |
{%- extends 'full.tpl' -%} | |
{# This template preserves collapsed outputs after conversion to html. | |
Put it in your templates directory, see template_path in jupyter_nbconvert_config.json | |
Usage: jupyter nbconvert --template collapsed_outputs FILE.ipynb #} | |
{%- block header -%} | |
{{ super() }} | |
<script> |
def lighten_color(color, amount=0.5): | |
""" | |
Lightens the given color by multiplying (1-luminosity) by the given amount. | |
Input can be matplotlib color string, hex string, or RGB tuple. | |
Examples: | |
>> lighten_color('g', 0.3) | |
>> lighten_color('#F034A3', 0.6) | |
>> lighten_color((.3,.55,.1), 0.5) | |
""" |
cmake_minimum_required(VERSION 3.8) | |
project(tsProject) | |
# Managing translations require LinguistTools module | |
# The cmake function is defined in the Qt installation tree: | |
# i.e. Qt5.9.1/5.9.1/gcc_64/lib/cmake/Qt5LinguistTools/Qt5LinguistToolsMacros.cmake | |
# Reference: https://doc.qt.io/qt-5/cmake-manual.html#qt5linguisttools-macros | |
find_package(Qt5 COMPONENTS Widgets LinguistTools) | |
set (CMAKE_CXX_STANDARD 11) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
// [dependencies] | |
// serde = "1.0" | |
// serde_derive = "1.0" | |
// serde_json = { version = "1.0", features = ["raw_value"] } | |
// fnv = "1.0.5" | |
// memmap = "0.7" | |
// smallvec = { version = "0.6", features = ["serde"] } | |
// jemallocator = "0.3" | |
use fnv::{FnvHashSet as HashSet, FnvHashMap as HashMap}; |
This post was adapted from an earlier Twitter thread.
It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.
It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)
And then there's Rollup, which apparently requires ESM to be u
type term = | |
| Lam of (term -> term) | |
| Pi of term * (term -> term) | |
| Appl of term * term | |
| Ann of term * term | |
| FreeVar of int | |
| Star | |
| Box | |
let unfurl lvl f = f (FreeVar lvl) |