Skip to content

Instantly share code, notes, and snippets.

View berceanu's full-sized avatar
:octocat:
long long ago; /* in a galaxy far far away */

Andrei Berceanu berceanu

:octocat:
long long ago; /* in a galaxy far far away */
View GitHub Profile
@berceanu
berceanu / sample.org
Created February 6, 2024 17:32
sample org file

Org Mode Sample Document

Headings and Structure

Write the document

Choose the document title

@berceanu
berceanu / histogram_bin_estimator.py
Created September 11, 2023 15:02
Estimate optimal number of histogram bins based on method of Shimazaki and Shinomoto.
"""
Shimazaki, Hideaki, and Shigeru Shinomoto.
"A method for selecting the bin size of a time histogram."
Neural computation 19.6, 1503 (2007).
https://doi.org/10.1162/neco.2007.19.6.1503
"""
import argparse
from pathlib import Path
import matplotlib.pyplot as plt
@berceanu
berceanu / README.md
Created August 20, 2023 17:00
How to enable key repeat for VIM mode in Cursor/VSCode editor
@berceanu
berceanu / speciesDefinition.param
Created October 27, 2022 15:13
PIConGPU ionization param files
#pragma once
#include "picongpu/simulation_defines.hpp"
#include "picongpu/particles/Particles.hpp"
#include <pmacc/particles/Identifier.hpp>
#include <pmacc/meta/conversion/MakeSeq.hpp>
#include <pmacc/identifier/value_identifier.hpp>
#include <pmacc/particles/traits/FilterByFlag.hpp>
#include <pmacc/meta/String.hpp>
@berceanu
berceanu / print_walker.py
Created October 15, 2022 20:39
Recursively traverse all source code files in the parent directory and convert them to syntax-highlighted PDF files
import subprocess
import os
START_DIR = '/data/storage/berceanu/Development/signac-driven-fbpic' # replace with your directory
DEST_DIR = '/data/storage/berceanu/Development' # replace with your directory
CMD = 'enscript -1rG --line-numbers --highlight=python -p - --color=0 {} | ps2pdf -i -o {}.pdf'
def print_source_code():
for dirname, subdirs, filenames in os.walk(START_DIR):
if 'env' in subdirs:
@berceanu
berceanu / config.yaml
Last active September 30, 2022 20:24
Zero to JupyterHub with Kubernetes: main configuration file
# This file can update the JupyterHub Helm chart's default configuration values.
#
# For reference see the configuration reference and default values, but make
# sure to refer to the Helm chart version of interest to you!
#
# Introduction to YAML: https://www.youtube.com/watch?v=cdLNKUoMc6c
# Chart config reference: https://zero-to-jupyterhub.readthedocs.io/en/stable/resources/reference.html
# Chart default values: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/HEAD/jupyterhub/values.yaml
# Available chart versions: https://jupyterhub.github.io/helm-chart/
#
@berceanu
berceanu / print_walker.py
Created September 14, 2022 16:20
Recursively convert all source code files in current folder to PDF
import subprocess
import os
START_DIR = '/Users/berceanu/Development/signac-driven-fbpic' # replace with your directory
DEST_DIR = '.' # replace with your directory
CMD = 'enscript -1rG --line-numbers --highlight=python -p - --color=0 {} | pstopdf -i -o {}.pdf'
def print_source_code():
for dirname, subdirs, filenames in os.walk(START_DIR):
if 'env' in subdirs:
@berceanu
berceanu / usage.md
Last active June 18, 2022 09:22
signac-driven-fbpic-usage

VPS

setup

$ ssh thorviaheimdall
$ conda activate /data/storage/berceanu/software/pkg/mambaforge_pic
$ cd /data/storage/berceanu/Development/signac-driven-fbpic/signac
@berceanu
berceanu / smilei_spack.md
Created May 5, 2022 08:03
Install instructions for Smilei using the spack package manager.
 . spack/share/spack/setup-env.sh
spack install openmpi@4.1.3 %gcc@9.4.0
spack load openmpi@4.1.3

spack install hdf5@1.12.2 %gcc@9.4.0 +cxx +fortran ^openmpi
spack load hdf5@1.12.2 

spack install ffmpeg@4.4.1 %gcc@9.4.0

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package: