- Set the filename in the properties section.
- Write terraform code in code blocks with
terraform
as the language. - Tangle the current file - shortcut is C-c C-v t.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Blog build and deploy | |
on: | |
push: | |
branches: | |
- "gh-actions" | |
pull_request: | |
branches: | |
- "master" | |
paths: | |
- ".github/workflows/deploy-site.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.tajd | |
package metaprogramming | |
import java.nio.file.{Files, Path, Paths} | |
import org.scalafmt.interfaces.Scalafmt | |
import scala.jdk.CollectionConverters._ | |
import scala.meta.{Term, _} | |
import scala.util.Try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if page.mermaid %} | |
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script> | |
<script>mermaid.initialize({startOnLoad:true});</script> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
def check_if_integer(col: pd.Series) -> bool: | |
"""Check if changing the data type of a series to integer changes its values.""" | |
return np.array_equal(col, col.astype(int)) | |
def reduce_mem_usage( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro create_table(table_name) %} | |
{% set sql %} | |
BEGIN; | |
DROP TABLE IF EXISTS {{ table_name[:-4] }}; | |
CREATE TABLE {{ table_name[:-4] }} AS SELECT * FROM {{ table_name }}; | |
GRANT SELECT ON {{ table_name[:-4] }} TO webview; | |
COMMIT; | |
{% endset %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
class Timer: | |
"""Class to assist with timing functions. | |
Start timing with | |
```my_timer = Timer()``` | |
And then get the time with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function genS_jl(I) | |
s0 = 600.0 | |
r = 0.02 | |
sigma = 2.0 | |
T = 1.0 | |
M = 100 | |
dt = T/M | |
a = (r - 0.5*sigma^2)*dt | |
b = sigma*sqrt(dt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Assist latex file editing. | |
Functions to assist with editing and compiling latex documents. | |
Thomas Dickson | |
26/12/2017 | |
""" | |
import click | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
@click.group() | |
def play_music(): | |
pass | |
@play_music.command() | |
def hello(): | |
click.echo('Here is our nokia composer! It accepts files containing music notes encoded in the microbit.music format.') |
NewerOlder