Skip to content

Instantly share code, notes, and snippets.

View mbritton's full-sized avatar
🏠
Working from home

Mike Britton mbritton

🏠
Working from home
View GitHub Profile
import * as THREE from 'three';
const gradientMaterial: THREE.ShaderMaterial = new THREE.ShaderMaterial({
uniforms: {
color1: {
value: new THREE.Color(0xffffff),
},
color2: {
value: new THREE.Color(0xf4f4f4),
},
@mbritton
mbritton / gist:5ce20b4c57088b68d745d5f2a312d318
Created February 17, 2023 07:08
Front end dependencies for a new project
"dependencies": {
"@prismicio/client": "^6.7.1",
"@prismicio/helpers": "^2.3.6",
"@prismicio/next": "0.1.9",
"@prismicio/react": "^2.5.0",
"@prismicio/slice-simulator-react": "^0.2.2",
"@react-three/fiber": "^8.9.1",
"aos": "^3.0.0-beta.6",
"dxf-parser": "^1.1.2",
"embla-carousel-react": "7.0.5",
from os import environ, path
from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
MODELDIR = "../../../model"
DATADIR = "../../../test/data"
# Create a decoder with certain model
config = Decoder.default_config()
@mbritton
mbritton / gist:59e6f2adad9b3ecf25e03b3e293701c5
Created January 3, 2023 23:59
X3DOM JavaScript Fix for Programmatically Applied Textures
x3dom.Texture.prototype.update = function () {
if (x3dom.isa(this.node, x3dom.nodeTypes.Text)) {
this.updateText();
} else {
this.updateTexture();
}
};
const Slideshow = expiryTimeStamp => {
let [fileName, setFileName] = useState(SLIDESHOW_DATA.images[ 0 ].fileName);
const onExpire = () => {
(imageNum < SLIDESHOW_DATA.images.length && SLIDESHOW_DATA.images[ imageNum + 1 ] !== undefined) ?
imageNum++
: imageNum = 0;
fileName = SLIDESHOW_DATA.images[ imageNum ].fileName;
glowColor = SLIDESHOW_DATA.images[ imageNum ].color;
startSlideshow();
@mbritton
mbritton / Locations.js
Last active October 9, 2018 04:41
openweather-apis and n00b mobx
import {decorate, observable, action} from 'mobx';
import weather from 'openweather-apis';
class Locations {
all = [
{
'id': 'fb3faf1a-1039-49f6-9ced-48dd9b5c1462',
'latitude': 33.9434136,
'longitude': -84.7758044,
@mbritton
mbritton / pin_icon.svg
Created October 17, 2017 01:14
Pin Icon
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
getRouteRows() {
var routeRows = []
for (var i = 0; i < this.props.routes.length; i++) {
let lItm = null
let infoBox = document.querySelector('.routesColumn')
if (infoBox !== null && infoBox.classList !== null && !infoBox.classList.contains('hidden')) {
lItm = <ListItem
style={ styles.itemStyle } value={ i }
onClick={this.onItemClick}
@mbritton
mbritton / LeafletMap.jsx
Created April 16, 2017 17:46
UI for map view of an application using Leaflet, React and Redux
import React, { Component } from 'react'
import { ReactDOM, render } from 'react-dom'
import { MapComponent, Map, Marker, Popup, TileLayer, GeoJson, LayerGroup, FeatureGroup, Circle } from 'react-leaflet'
import { showElevationChart, setZoomSnap, progressEventAction, sendLatLons } from '../actions/applicationActions.js'
import { fetchCountyData } from '../actions/countyActions.js'
import { fetchRoutes, toggleSelectedRoute, loadRoute, hideRoutes, showRoutes } from '../actions/routesActions.js'
import { fetchTrailheadMarkers, getToolTip, setLeafletMarkers, doMarkerSelected } from '../actions/markersActions.js'
@mbritton
mbritton / gist:c97096ab430d9ffd28a9c1c0f05f4ffc
Created April 2, 2017 13:46
This smacks of desperation
gulp.task('clean', function() {
return exec("echo '$MikesPassword' | sudo -S rm -R " + paths.buildDirectory);
});