Skip to content

Instantly share code, notes, and snippets.

@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 / 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.
@theothermattm
theothermattm / oracle-health-check.sql
Created Feb 21, 2019
Bash script to check health of an oracle instance
View oracle-health-check.sql
# original source based on: https://github.com/fabiohbarbosa/docker-healthcheck-oracle/blob/master/assets/healthcheck.sh
CHECK=$(${ORACLE_HOME}/bin/sqlplus -s ${HEALTHCHECK_USER}/${HEALTHCHECK_PASSWORD}@localhost/${HEALTHCHECK_SERVICE_NAME} as sysdba <<END
--set pagesize 0 feedback off verify off heading off echo off;
-- the simplest type of health check
--select count(*) from dual;
-- this will check if a
SELECT count(*) FROM V\$INSTANCE where INSTANCE_NAME = 'xe' and DATABASE_STATUS = 'ACTIVE';
exit;
END
@theothermattm
theothermattm / oracle-delete-all-tables.sql
Created Feb 15, 2019
Delete All Tables in an Oracle Schema
View oracle-delete-all-tables.sql
-- https://stackoverflow.com/questions/1690404/how-to-drop-all-user-tables
BEGIN
FOR cur_rec IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN
('TABLE',
'VIEW',
'PACKAGE',
'PROCEDURE',
View experimental-culture.md

Tom Chi - Learning Through Prototyping

()[https://www.youtube.com/watch?v=kuqgrvUPc5g]

  • Better to reason with experience/data than guesses
    • Find the quickest path to experience
    • Doing is the best kind of thinking.
  • Smart people will always have good defenses of their guesses
  • "Am I hearing a guess, or am I hearing direct experience?"
  • We want experience
@theothermattm
theothermattm / gitignoresync.sh
Created Jul 28, 2017
Sync files using .gitignore
View gitignoresync.sh
rsync -azP --delete --filter=":- .gitignore" . targethost:/targetdirectory
@theothermattm
theothermattm / convert-crt-to-pem.sh
Created Jul 20, 2016
Convert .crt to .pem for CA's
View convert-crt-to-pem.sh
# from https://github.com/nodejs/node/issues/3742#issuecomment-225939382
openssl x509 -inform der -in /Path/to/the.crt -out /Path/to/the/file.pem