Skip to content

Instantly share code, notes, and snippets.

View mattboldt's full-sized avatar

Matt Boldt mattboldt

View GitHub Profile
tell application "UA Mixer Engine"
if it is running then
quit
else
launch
end if
end tell
@mattboldt
mattboldt / creative-cloud-disable.md
Created November 6, 2021 18:22 — forked from andreibosco/creative-cloud-disable.md
disable creative cloud startup on mac
@mattboldt
mattboldt / textfield.js
Created June 2, 2021 23:07 — forked from roshangautam/textfield.js
Override Default textfield.js to remove is-invalid by default for required textfields.
(function() {
'use strict';
MaterialTextfield = window['MaterialTextfield'];
/**
* Handle lost focus.
*
* @private
*/
@mattboldt
mattboldt / MyComponent.js
Last active May 3, 2020 23:59
ES6 Set and Map with React Hooks
import React from 'react'
import useRefProxy from './useRefProxy'
const MyComponent = () => {
const [state, setProxy] = useRefProxy(new Set([1, 2, 3, 4]))
const [mapState, mapProxy] = useRefProxy(
new Map([
[1, { foo: 1 }],
[2, { foo: 2 }],
])
@mattboldt
mattboldt / react form with FormData.jsx
Last active February 7, 2020 16:59
React Form refactor
// And option B: leveraging `FormData`
handleSubmit = (e) => {
e.preventDefault()
// Use our this.form ref we set in `<form>` below
const form = this.form
// Use the `FormData` API
const data = new FormData(form)
// Translate our `FormData` object to api-friendly json
@mattboldt
mattboldt / ActiveModel.ts
Created January 30, 2020 16:53
TypeScript OOP Bullshit
class MapProxy {
public map = new Map<string, any>()
keys() {
return this.map.keys()
}
values() {
return this.map.values()
}
get(key: string) {
return this.map.get(key)
@mattboldt
mattboldt / class-vs-hooks.jsx
Last active September 25, 2019 18:03
React Classes v.s. Hooks when communicating with a REST api
const List = () => {
// Items would come from an API
const items = [{ id: 1, active: true, complete: false }, ...]
return (
<ul>
{items.map((item) => (
<ListItem item={item} />
))}
</ul>
)
@mattboldt
mattboldt / putonglasses.txt
Created December 4, 2018 22:00 — forked from cheeaun/putonglasses.txt
put on glasses unicode
•_•)
( •_•)>⌐■-■
(⌐■_■)
@mattboldt
mattboldt / route-differ.md
Created August 13, 2018 18:57
Route differ
git checkout ams_master
rake routes | cat > routes1.txt

git checkout organize_routes
rake routes | cat > routes2.txt

diff -u routes1.txt routes2.txt
#=&gt; no diff results!
@mattboldt
mattboldt / Route raker Instructions.md
Last active August 31, 2017 23:55
Rake those routes!
  • Copy contents of file into a route located outside of any repos.
  • cd /YOUR-REPO-DIR/
  • chmod +x route
  • ln -s $PWD/route /usr/local/bin/

Usage:

route my_new_route