Skip to content

Instantly share code, notes, and snippets.

View matthewepler's full-sized avatar

Matthew Epler matthewepler

View GitHub Profile
# Creates a gamma-corrected lookup table by @hexagon5un
# 04/23: updated file handle func and template strings for python 3,
# uses byte datatype instead of int,
# uses PROGMEM for storing table in memory (accessed with pgm_read_byte in Arduino),
# added explanatory comments and number padding (@matthewepler)
import math
def gamma(nsteps, gamma):
gammaedUp = [math.pow(x, gamma) for x in range(nsteps)]
@matthewepler
matthewepler / virtual_machine_xml
Created March 25, 2021 00:49
virtual_machine_xml
<domain type="kvm">
<name>win10</name>
<uuid>7e901143-ea2e-4fd6-be85-2f5e57b3b130</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/10"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">8388608</memory>
<currentMemory unit="KiB">8388608</currentMemory>
@matthewepler
matthewepler / default.xml
Created March 25, 2021 00:48
/usr/share/libvirt/networks/default.xml
<network>
<name>default</name>
<bridge name="virbr0"/>
<forward mode="nat"/>
<ip address="192.168.122.1" netmask="255.255.255.0">
<dhcp>
<range start="192.168.122.2" end="192.168.122.254"/>
</dhcp>
</ip>
<ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64"/>
Author: Matthew Barnett
Author-email: regex@mrabarnett.plus.com
Maintainer: Matthew Barnett
Maintainer-email: regex@mrabarnett.plus.com
License: Python Software Foundation License
Description: Introduction
------------
This regex implementation is backwards-compatible with the standard 're' module, but offers additional functionality.
total 3008
drwxrwxr-x 212 root admin 6.6K Aug 28 12:33 .
drwxrwxr-x 208 root admin 6.5K Jul 15 2019 ..
drwxr-xr-x 8 user19943211 admin 256B Dec 16 2019 Click-7.0.dist-info
drwxr-xr-x 8 user19943211 admin 256B Aug 15 2019 ConfigArgParse-0.14.0-py3.7.egg-info
drwxr-xr-x 103 user19943211 admin 3.2K Aug 15 2019 PIL
drwxr-xr-x 9 user19943211 admin 288B Aug 15 2019 Pillow-6.1.0.dist-info
drwxr-xr-x 8 user19943211 admin 256B Aug 15 2019 Pint-0.9.dist-info
drwxr-xr-x 8 user19943211 admin 256B Aug 15 2019 PySocks-1.7.0.dist-info
drwxr-xr-x 7 user19943211 admin 224B Aug 15 2019 PyYAML-5.1.2-py3.7.egg-info
altgraph==0.10.2
asn1crypto==0.24.0
bcrypt==3.1.6
bdist-mpkg==0.5.0
bonjour-py==0.3
cffi==1.12.3
configparser==3.7.4
contextlib2==0.6.0.post1
cryptography==2.7
entrypoints==0.3
" ---------------
set nocompatible " be IMproved, required by Vundle
filetype off " required by Vundle
syntax on
set hidden " allows for use of split windows
set wildmenu " Better command-line completion
set showcmd " Show partial commands in the last line of the screen
set ignorecase " Use case insensitive search...
set smartcase " ...except when using capital letters
set backspace=indent,eol,start
**:messages**
Messages maintainer: Bram Moolenaar <Bram@vim.org>
Traceback (most recent call last):
File "<string>", line 27, in <module>
File "/Users/user19943211/.vim/bundle/youcompleteme/python/ycm/base.py", line 18, in <module>
from ycm import vimsupport
File "/Users/user19943211/.vim/bundle/youcompleteme/python/ycm/vimsupport.py", line 23, in <module>
from ycmd.utils import ( ByteOffsetToCodepointOffset,
File "/Users/user19943211/.vim/bundle/youcompleteme/third_party/ycmd/ycmd/utils.py", line 58, in <module>
@matthewepler
matthewepler / tracker.js
Created June 26, 2018 21:25
tracking pageviews with HOC in single page application - Keen + Google Analytics
import React, { Component } from 'react';
import Keen from 'keen-tracking';
import MobileDetect from 'mobile-detect';
import GoogleAnalytics from 'react-ga';
const debug = process.env.NODE_ENV === 'development';
const rootURL = debug ? 'http://localhost:3000' : 'https://helloroo.org'; // see line 51
GoogleAnalytics.initialize(`${debug ? 'UA-121464346-2' : 'UA-121464346-1'}`, {
debug,
const state = {
crystalSize: CRYSTAL_SIZE,
sides: SIDES ,
stepsOut: 8,
thinStroke: 1,
thickStroke: 3
}
const setState = (state) => {
state.numShapes = state.sides