Skip to content

Instantly share code, notes, and snippets.

View charnley's full-sized avatar
😎
make fun

Jimmy C. Kromann charnley

😎
make fun
View GitHub Profile
@EverythingSmartHome
EverythingSmartHome / flexispot-e7pro-voice.yaml
Created November 13, 2024 18:32
flexispot-e7pro-voice-assistant
esphome:
friendly_name: flexispot-e7q
name: flexispot-e7q
platformio_options:
board_build.flash_mode: dio
on_boot:
- priority: -10
then:
- button.press: button_m
- priority: 600
@MindPatch
MindPatch / alacritty.yml
Created September 29, 2021 23:38
my alacritty terminal config file
key_bindings:
- { key: V, mods: Command, action: Paste }
- { key: C, mods: Command, action: Copy }
- { key: Q, mods: Command, action: Quit }
- { key: N, mods: Command, action: SpawnNewInstance }
- { key: Return, mods: Command, action: ToggleFullscreen }
- { key: Home, chars: "\x1bOH", mode: AppCursor }
- { key: Home, chars: "\x1b[H", mode: ~AppCursor }
- { key: End, chars: "\x1bOF", mode: AppCursor }
@andersx
andersx / xyz2om2.py
Created June 14, 2020 15:54
XYZ to OM2
#!/usr/bin/env python2
import numpy as np
import sys
elements = dict()
elements["H"] = 1
elements["C"] = 6
elements["N"] = 7
elements["O"] = 8
elements["F"] = 9
@ptosco
ptosco / FragmentOnBonds.ipynb
Created January 8, 2020 11:47
Different ways to fragment a molecule on some bonds
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jerriclynsjohn
jerriclynsjohn / 1.rollup.config.js
Last active February 25, 2022 15:42
Svelte + Tailwind + Storybook - Starter Template
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
import postcss from 'rollup-plugin-postcss';
import autoPreprocess from 'svelte-preprocess';
const production = !process.env.ROLLUP_WATCH;
@larsbratholm
larsbratholm / mae_ci.py
Last active March 8, 2020 11:05
Calculate 95% confidence interval for rapported MAE. The data is assumed to follow a laplacian distribution.
"""
Calculate 95% confidence interval for rapported MAE.
The data is assumed to follow a laplacian distribution.
See https://waset.org/publications/8809/confidence-intervals-for-double-exponential-distribution-a-simulation-approach
for derivation.
"""
import numpy as np
import scipy.stats as ss
@andersx
andersx / test_fchl_energy.py
Created April 15, 2019 09:15
KRR and OQML energy regression tests
from __future__ import print_function
import os
import csv
import ast
from copy import deepcopy
import scipy
@andersx
andersx / mp_loop_example.py
Created January 31, 2019 14:40
Multiprocessing loop example
def multiprocessing_func(pids, compounds_list, rd):
for i in pids:
rep_out = generate_fchl_acsf(
compounds[i].nuclear_charges,
compounds[i].coordinates,
**rep_params)
rd[i] = rep_out
manager = mp.Manager()
@andersx
andersx / kpca.py
Last active October 18, 2018 09:19
Kernel PCA for QML kernels (ndarray)
import numpy as np
import scipy
def kpca(K, n=2, centering=True):
assert K.shape[0] == K.shape[1], "Square matrix required for Kernel PCA."
assert np.allclose(K, K.T, atol=1e-8), "Symmetric matrix required for Kernel PCA."
# First center kernel.
@ptosco
ptosco / XYZSmilesToMol.ipynb
Last active December 16, 2022 06:45
XYZSmilesToMol
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.