Skip to content

Instantly share code, notes, and snippets.

@jamiely
jamiely / offline_map.md
Created September 1, 2012 19:17
Generating offline maps for iOS applications

Intro

Recently, I had to implement an offline mapping solution for an iOS application. Here's a walkthrough of how to do it.

Summary

I generated a tile database using TileMill. I used the Route-Me iOS library which provides a map view that supports offline tile sources.

TileMill

@jamiely
jamiely / new_machine.sh
Last active August 18, 2021 17:13
New OSX Machine Script
# install xcode via App Store first! It takes awhile
# install the command-line tools as well
# install growl from App Store
# Used for git config and ssh keygen
NAME="First Last"
EMAIL="email@example.com"
# The main directory where you will keep your code
CODE_DIR=~/code
@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
@jamiely
jamiely / InformationCentrality.java
Created August 7, 2011 04:57
Information Centrality Algorithms
//http://code.google.com/p/mason/source/browse/trunk/contrib/socialnets/sim/field/network/stats/actorcentrality/InformationCentrality.java?r=355
/*
Copyright 2010 by Sean Luke and George Mason University
Licensed under the Academic Free License version 3.0
See the file "LICENSE" for more information
*/
package sim.field.network.stats.actorcentrality;
import sim.field.network.stats.*;
import sim.field.network.*;
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