Skip to content

Instantly share code, notes, and snippets.

View nathanmargaglio's full-sized avatar

Nathan Margaglio nathanmargaglio

View GitHub Profile
@nathanmargaglio
nathanmargaglio / virtual_display.sh
Last active November 23, 2019 04:17
Creating a Virtual Display for VNC using XRandR
# Create new modes
xrandr --newmode virtual_mode $(cvt 1920 1080 60 | grep -oP "\".*\" \K(.*)")
xrandr --newmode note10 $(cvt 2280 1080 60 | grep -oP "\".*\" \K(.*)")
xrandr --newmode note10_half $(cvt 1144 540 60 | grep -oP "\".*\" \K(.*)")
xrandr --newmode note10_half_flip $(cvt 540 1144 60 | grep -oP "\".*\" \K(.*)")
xrandr --newmode tablet $(cvt 1280 800 30 | grep -oP "\".*\" \K(.*)")
xrandr --newmode tablet_half $(cvt 640 400 30 | grep -oP "\".*\" \K(.*)")
xrandr --newmode tablet_quart $(cvt 960 600 30 | grep -oP "\".*\" \K(.*)")
export XMODE=tablet_quart
@nathanmargaglio
nathanmargaglio / init.vim
Last active September 27, 2019 21:22
NeoVim Config
" auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.config/nvim/plugged')
@nathanmargaglio
nathanmargaglio / basic-numpy-test.ipynb
Last active November 4, 2019 15:55
Basic Numpy Test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nathanmargaglio
nathanmargaglio / paint_app.py
Created March 6, 2020 16:28
Dash Drawing App
from data_processing import ds_data, image_df, model
from common import numpy_to_base64
import numpy as np
import json
import time
from flask import Flask, request
import dash
import dash_core_components as dcc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nathanmargaglio
nathanmargaglio / DQN.ipynb
Created October 9, 2020 12:36
DQN Tutorial
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nathanmargaglio
nathanmargaglio / keybase.md
Created October 19, 2020 20:56
keybase.md

Keybase proof

I hereby claim:

  • I am nathanmargaglio on github.
  • I am nathanmargaglio (https://keybase.io/nathanmargaglio) on keybase.
  • I have a public key whose fingerprint is AF9F 8C1D 1DF4 B7BA 8E10 177B 3C42 9815 E65F 6573

To claim this, I am signing this object:

@nathanmargaglio
nathanmargaglio / merge.py
Last active August 13, 2021 16:03 — forked from mfehr/mergebag.py
Merge ROS Bags
#!/usr/bin/env python
# From https://gist.github.com/mfehr/305c1d07f6ca6a6e70afe1f155843d17
import rosbag
import argparse
import os
import logging
logging.basicConfig()
@nathanmargaglio
nathanmargaglio / bsm_model.py
Created January 8, 2022 17:35
Black-Scholes-Merton (BSM) model
from math import log, sqrt, exp
import scipy.stats as stats
import numpy as np
# from https://www.quantconnect.com/tutorials/introduction-to-options/options-pricing-black-scholes-merton-model
class BsmModel:
def __init__(self, option_type, price, strike, interest_rate, expiry, volatility=None, target_price=None, dividend_yield=0):
self.s = price # Underlying asset price