Skip to content

Instantly share code, notes, and snippets.

@gabraganca
gabraganca / output_toggle_html.tpl
Last active February 15, 2017 17:37
Template to use with `ipython nbconvert` when generating HTML. With this, all input cell are hidden. Thanks @damianavila for the initial setup (http://www.damian.oquanta.info/posts/hide-the-input-cells-from-your-ipython-slides.html). I have also take some code from the `custom.css` of @olgablot published in http://nbviewer.ipython.org/5357268.
{%- extends 'full.tpl' -%}
{% block input_group -%}
<div class="input_hidden">
{{ super() }}
</div>
{% endblock input_group %}
{%- block header -%}
{{ super() }}
@mcandre
mcandre / docker-push-tag-alias.md
Created May 18, 2015 17:22
How to create new tag aliases for docker images
$ docker tag <image>:<original tag> <image>:<alias>
$ docker push <image>:<alias>
@foonathan
foonathan / borrow.cpp
Last active August 24, 2023 08:42
Quick'n'dirty implementation of Rust's borrow checker for a C++Now Lightning Talk - not supposed to be used
#include <iostream>
#include "borrow_checker.hpp"
int main()
{
auto i = 42;
// borrow `i` under name `ref`
borrow_var(ref, i)
@mbinna
mbinna / effective_modern_cmake.md
Last active July 19, 2024 02:18
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@mandrean
mandrean / Install Apple Clang 12 next to Apple Clang 13
Created January 23, 2022 02:15
Install Apple Clang 12 next to Apple Clang 13
# download 'Command_Line_Tools_for_Xcode_12.5.1.dmg' from Apple's developer portal:
# https://developer.apple.com/download/all/?q=xcode
# mount 'Command_Line_Tools_for_Xcode_12.5.1.dmg', then unpack it
❯ pkgutil --expand-full /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools.pkg /tmp/CLTools
# rename existing CLTools v13
❯ sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools@13
# move CLTools v12 into place