Skip to content

Instantly share code, notes, and snippets.

@jamiely
jamiely / cmake.log
Created May 15, 2021 01:20
Error without guards
cmake -S . -B build && cmake --build build && (cd build && ctest --output-on-failure)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jamiely/code/tmp/cpp_chess_bot/build
Consolidate compiler generated dependencies of target gtest
[ 5%] Built target gtest
Consolidate compiler generated dependencies of target gtest_main
[ 11%] Built target gtest_main
Consolidate compiler generated dependencies of target board_test
[ 13%] Building CXX object CMakeFiles/board_test.dir/tests/board_test.cpp.o
pip list | grep -v pip | grep -v setuptools | grep -v powerline | awk '{ print $1 }' | xargs -I'{}' pip uninstall -y {}
@jamiely
jamiely / bash.md
Last active August 7, 2018 15:20
Split an mp3 file into many parts

Let's say you have a few files:

  • 01.mp3
  • 02.mp3
  • 03.mp3

They are really large audio books, so you want to split them into chapters. You don't care about the chapter lengths.

Let's create a function to split them up. First, we want to create a directory to hold them

@jamiely
jamiely / async.md
Last active June 27, 2018 00:53
Akka Stream async boundary

I'm somewhat experienced with Akka Actors, but wanted to try Streams since it is the new hotness and compatible with the reactive streams initiative.

My use case is that I want to create a Source[GetActivityTaskResult] to interact with an AWS Step Functions State Machine. Basically, I want to poll for tasks that my workers can operate on.

So I have code like this:

@jamiely
jamiely / zsh_problem.md
Created June 20, 2018 18:00
zsh immediately closing terminal window

I was suddenly having a problem after reinstalling python2 with brew

brew install python@2

Suddenly when opening new terminal windows, the window would close immediately (I wasn't able to see an error message).

Changing the default shell from zsh to /bin/bash seemed to fix the problem. I thought there might be a problem with the startup script, so I renamed it.

@jamiely
jamiely / zsh_problem.md
Created June 20, 2018 18:00
zsh immediately closing terminal window

I was suddenly having a problem after reinstalling python2 with brew

brew install python@2

Suddenly when opening new terminal windows, the window would close immediately (I wasn't able to see an error message).

Changing the default shell from zsh to /bin/bash seemed to fix the problem. I thought there might be a problem with the startup script, so I renamed it.

@jamiely
jamiely / data_science_pipeline.md
Last active June 19, 2018 19:24
Data Science Pipeline Notes

Workflow Coordinators

  • Apache Airflow
  • Pachyderm

Managed

  • Apache SageMaker
@jamiely
jamiely / text.md
Created June 19, 2018 02:47
When piping with jq, always include some pattern

How to pipe with jq. Make sure to include a pattern:

jq . < text.json | tee results.json

NOT

jq &lt; text.json | tee results.json
@jamiely
jamiely / text.md
Created June 19, 2018 02:45
Encrypt/Decrypt a file for yourself using keybase

Encrypt a file for yourself using keybase

keybase encrypt my_keybase_username -b -i my.tgz -o my.tgz.enc

Decrypt

keybase decrypt -i my.tgz.enc -o my.tgz
@jamiely
jamiely / text.md
Created June 19, 2018 02:42
Run `mvn compile` whenever a Java file changes in a particular directory.

Run mvn compile whenever a Java file changes in a particular directory.

brew install watchman
watchman-make --make mvn -p 'src/main/java/**/*.java' -t compile