Skip to content

Instantly share code, notes, and snippets.

Matt M. theothermattm

Block or report user

Report or block theothermattm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@theothermattm
theothermattm / docker-compose-override-commands.md
Created Feb 20, 2020
Using docker compose with overrides
View docker-compose-override-commands.md

Because I always forget the right order of passing in arguments!

Example up command with background process flag set:

docker-compose -f docker-compose.yml -f docker-compose-override-file.yml up -d myservice name
@theothermattm
theothermattm / sync-using-gitignore.sh
Created Oct 7, 2015
Rsync files using .gitignore
View sync-using-gitignore.sh
# sync everything excluding things in .gitignore
# delete anything on target not in source
# include dotfiles and symlinks, also use compression
rsync -azP --delete --filter=":- .gitignore" . my-target-host:/my/target/directory
View go-to-coding-resources.md
@theothermattm
theothermattm / docker-compose-cheatsheet.md
Created Dec 6, 2019
docker-compose command cheatsheet
View docker-compose-cheatsheet.md

build everything in the docker-compose.yaml file

docker-compose build

build just one service in docker-compose.yaml file

docker-compose build myservice

run everything in the docker-compose.yaml file

@theothermattm
theothermattm / install-python-macos.md
Last active Oct 8, 2019
Installing Python so it doesn't suck on MacOS
View install-python-macos.md

Thanks to @kevlarr for this info... Saving it myself for reference.

The easiest way to get started is via pyenv and virtualenv.

  • Install pyenv via brew install pyenv
  • Add eval "$(pyenv init -)" to your bash, etc. profile if you want to enable autocomplete (hint: you do),
  • Install project Python version via pyenv install 3.6.81

1 If you are running Mojave and are having issues building (looking at you, zlib), you likely need to install C header files

@theothermattm
theothermattm / mysql-dummy-data.sql
Created Aug 20, 2019
Create Dummy Data with MySQL Stored Proc
View mysql-dummy-data.sql
/* based on https://stackoverflow.com/a/17268740/288935 */
CREATE PROCEDURE insert_test_data()
BEGIN
DECLARE i INT default 1;
DECLARE mydate DATE DEFAULT NOW();
SET mydate = DATE_ADD('2017-05-01 00:01:00', INTERVAL FLOOR(RAND() * 700) DAY);
WHILE i < 1000000 DO
INSERT INTO `telemetry_test` (`humidity`, `temperature`, `sql_insert`, `sql_update`)
@theothermattm
theothermattm / remove-matched-pattern.sh
Created Jul 12, 2019
Sed - remove matched pattern simple script
View remove-matched-pattern.sh
# this chains them to make the regex easier to follow
sed -n -e 's/^${FIRSTPATTERN}//p' test.txt | sed -n -e 's/${SECONDPATTERN}//p'
@theothermattm
theothermattm / node-debugging.md
Created Jun 14, 2019
Debugging w/ Node.js and Chrome
View node-debugging.md

Node debugging with chrome

See this article first.

Use node --inspect

Most of the time it should give you a chrome URL. If not, go to about:inspect in chrome and you should see a target to inspect

Using mocha

View node-ca-certs.md
View engineering-culture-notes.md

Some of the greatest info I've seen on creating a healthy engineering courtesy of Spotify:

Spotify Engineering Culture Part 1

TODO make notes on this one

Spotify Engineering Culture Part 2

  • 0:50 - "We aim to make mistakes faster than anyone else" - Fail Fast and Improve Fast.
  • 1:30 - "Fail Friendly Environment" - Encourage sharing of failures so everyone can learn from them. Some teams have "Fail walls" showing off their failures.
You can’t perform that action at this time.