Skip to content

Instantly share code, notes, and snippets.

@Bertbk
Bertbk / converter.py
Created March 23, 2020 13:20
Mesh converter for élise
#!/usr/bin/python3
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument("input")
parser.add_argument("-o")
args = parser.parse_args()
input_name, input_extension = os.path.splitext(args.input)
@Bertbk
Bertbk / people.html
Created February 24, 2020 12:42
people widget
{{/* People Widget */}}
{{/* Initialise */}}
{{ $ := .root }}
{{ $page := .page }}
{{ $show_social := $page.Params.design.show_social | default false }}
{{ $show_interests := $page.Params.design.show_interests | default true }}
{{ $show_organizations := $page.Params.design.show_organizations | default false }}
<div class="row justify-content-center people-widget">
@Bertbk
Bertbk / .gitlab-ci.yml
Created October 3, 2019 08:31
Gitlab CI for Hugo (+ Academic theme)
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SSL_NO_VERIFY: "true"
pages:
image: monachus/hugo:latest
before_script:
- apt-get update -y -qq
- apt-get install git -y -qq
- git submodule update --init --recursive
@Bertbk
Bertbk / gist:9eaacd65813311dea1b2b9bee08d87bb
Created January 21, 2019 15:52
Selected to Featured (hugo academic)
# Found here
# https://stackoverflow.com/questions/4205854/python-way-to-recursively-find-and-replace-string-in-text-files
import os, fnmatch
def findReplace(directory, find, replace, filePattern):
for path, dirs, files in os.walk(os.path.abspath(directory)):
for filename in fnmatch.filter(files, filePattern):
filepath = os.path.join(path, filename)
with open(filepath) as f:
s = f.read()