Skip to content

Instantly share code, notes, and snippets.

@RuhiRG
RuhiRG / gsoc23_pyseams_fin_report.md
Last active August 28, 2023 22:58
GSoC 2023: Python Bindings for d-SEAMS under the PSF

PYSEAMS : Python bindings for d-SEAMS

d-SEAMS (Deferred Structural Elucidation Analysis for Molecular Simulations), a free and open-source post-processing engine for the analysis of molecular dynamics trajectories, which is specifically able to qualitatively classify ice structures, in both strong confinement and bulk systems.

The objective of my project was to create Python bindings to the seams-core C++ engine of d-SEAMS. I named my bindings repository and project as pyseams with the importable name cyoda in keeping with yodaStruct and yodaLib from d-SEAMS. The d-SEAMS project provided lua bindings which many users may find difficult. I wrote bindings with pybind11 for the functions and classes present in d-SEAMS. Each basic example has it's own file in pyseams, which users can run. Initially, d-SEAMS didn't support the latest version of Macos but I worked to ensure M1-Macos users can use d-SEAMS as well.

Beyond th

@bgeneto
bgeneto / numpy-eigen-bench.md
Last active May 5, 2024 22:15
numpy eigen benchmark

Purpose

To benchmark Python (Numpy) default procedure to find all eigenvalues and eigenvectors of a complex (hermitian) matrix and compare the results with Fortran using either MKL and OpenBLAS libraries.

Python code

import time
import numpy as np
@stefanv
stefanv / http_server_python
Last active September 23, 2021 07:45
Multi-threaded HTTP server in Python
#!/usr/bin/env python3
# See https://github.com/Nakiami/MultithreadedSimpleHTTPServer/blob/master/MultithreadedSimpleHTTPServer.py
# Python 3.x
from socketserver import ThreadingMixIn
from http.server import SimpleHTTPRequestHandler, HTTPServer
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
pass
@ryuheechul
ryuheechul / windows.md
Last active March 13, 2024 02:23
Let that Windows 10/11 be a bit friendlier

An attempt to make Windows 10/11 work for me by customizing/personalizing it

Why gist not dotfiles?

I use dotfiles to personalize *nix type of machines. But I'm new to personalizing Windows 10. So I'm collecting information here first before adding these to the dotfiles. I'm not sure if these will ever move to dotfiles though.

Enable WSL2

@agzam
agzam / zathura-client.org
Last active May 6, 2024 03:48
Open pdf files with Zathura on Mac

Zathura on Mac

I want to open PDF files with Zathura on Mac. Problem is - Zathura does not have a proper App Bundle. So you cannot go in Finder to a pdf file, navigate to ‘Get Info’ and set pdf files to be opened with Zathura.

Luckily, you can create a custom App Bundle that wraps up a script that does that

But that is not as straightforward as you think it is, you can’t just execute a shell script. What if the file already opened with one of the instances of zathura process? Since Zathura is not a native OSX app, it will create a new process instance every time you open it.

The following script opens a file in Zathura, and if it was already opened, it would only activate the right window.

How to use it

@mcarilli
mcarilli / nsight.sh
Last active May 10, 2024 08:48
Favorite nsight systems profiling commands for Pytorch scripts
# This isn't supposed to run as a bash script, i named it with ".sh" for syntax highlighting.
# https://developer.nvidia.com/nsight-systems
# https://docs.nvidia.com/nsight-systems/profiling/index.html
# My preferred nsys (command line executable used to create profiles) commands
#
# In your script, write
# torch.cuda.nvtx.range_push("region name")
# ...
@bencbartlett
bencbartlett / hydrogen_orbitals.nb
Last active November 27, 2021 03:10
Mathematica code for this animation of transitions in hydrogen wavefunctions: https://twitter.com/bencbartlett/status/1287802625602117632
<< MaTeX`
SetOptions[MaTeX, "Preamble" -> {"\\usepackage{color,txfonts}"}];
SetDirectory[NotebookDirectory[]];
Clear[drawLadder];
drawLadder[n_, l_, m_, imsize_: 500] := Module[{maxrungs = 5, mag = 4},
Graphics[{
White, Opacity[1], Thickness[.02], Dashing[None],
Table[Line[{{0, k}, {1, k}}], {k, maxrungs}], (*draw n lines*)
@travisbrown
travisbrown / response-de-goes.md
Last active March 31, 2024 14:41
Response to cease and desist letter from John A. De Goes, CEO of Ziverge
---
title: "Coloring stuff!"
author: "Andrew Heiss"
date: "`r Sys.Date()`"
output:
xaringan::moon_reader:
lib_dir: "libs"
seal: false # No title slide
nature:
highlightStyle: github
@chriselsner
chriselsner / nix-on-macos-catalina.md
Last active January 24, 2024 18:35
Nix on macOS Catalina

Nix on macOS Catalina

I'm writing this gist for my own records but it might help someone else too.

Installing Nix

Support for Catalina has improved a lot since the update was first rolled out.

Note: See the NixOS manual for discussion of the --darwin-use-unencrypted-nix-store-volume option.