Skip to content

Instantly share code, notes, and snippets.

View milespossing's full-sized avatar

Miles Possing milespossing

View GitHub Profile
{
"version": 1,
"notes": "",
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard": "planck/rev6",
"keymap": "planck_rev6_layout_ortho_4x12_mine",
"layout": "LAYOUT_ortho_4x12",
"layers": [
[
"KC_TAB",
@milespossing
milespossing / model_interpretation.py
Created November 30, 2021 00:18
Model interpretation using vectorized logistic regression (word list coefficients provided
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
all_data = pd.read_table('alldata.tsv')
dict = {pair[1]['token']:pair[1]['coef'] for pair in all_vocab[['token','coef']].iterrows()}
vectorizer = CountVectorizer(vocabulary=all_vocab['token'].values, max_df=0.3, ngram_range=(1, 2), min_df=20)
cur_vocab = vectorizer.get_feature_names()
def get_tokens(review):
@milespossing
milespossing / position_system.rs
Created November 10, 2021 05:25
Simple position system for ray tracing
use amethyst::{
ecs::{System, WriteStorage, Read, Join},
core::timing::Time,
};
use crate::rays::Ray;
pub struct PositionSystem;
impl<'a> System<'a> for PositionSystem {
type SystemData = WriteStorage<'a, Ray>;
@milespossing
milespossing / Ray.rs
Last active November 10, 2021 05:23
Simple ray for ray tracer
use amethyst::{
core::math::{Vector3},
ecs::{Component, VecStorage},
};
#[derive(Debug)]
pub struct Ray {
pub pos: Vector3<f32>,
pub vel: Vector3<f32>,
}