Skip to content

Instantly share code, notes, and snippets.

View hokru's full-sized avatar
💩

Holger Kruse hokru

💩
View GitHub Profile
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@danielhfrank
danielhfrank / pydantic.py
Created December 1, 2020 00:15
Pydantic with Numpy
from typing import Generic, TypeVar
import numpy as np
from pydantic.fields import ModelField
JSON_ENCODERS = {
np.ndarray: lambda arr: arr.tolist()
}
DType = TypeVar('DType')
@sfujiwara
sfujiwara / cg.py
Created December 31, 2015 19:47
conjugate gradient method implemented with python
# -*- coding: utf-8 -*-
import numpy as np
from scipy.sparse.linalg import cg
import tensorflow as tf
import time
def conjugate_grad(A, b, x=None):
"""
@mretegan
mretegan / mep.py
Last active June 15, 2024 10:16
Create a .cube file of the molecular electrostatic potential using ORCA.
"""
(c) 2013, 2019, 2022 Marius Retegan
License: BSD-2-Clause
Description: Create a .cube file of the molecular electrostatic
potential (MEP) using ORCA.
Run: python mep.py basename npoints nprocs (e.g. python mep.py water 40 2).
Arguments: basename - file name without the extension;
this should be the same for the .gbw and .scfp.
npoints - number of grid points per side
(80 should be fine)