Skip to content

Instantly share code, notes, and snippets.

Peter karussell

Block or report user

Report or block karussell

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
@karussell
karussell / install-android-sdk-linux.txt
Last active May 31, 2019
Install Android SDK for graphhopper/android
View install-android-sdk-linux.txt
https://developer.android.com/studio/#downloads => sdk-tools-linux-4333796.zip
mkdir android-sdk-linux
cd android-sdk-linux
unzip ~/Downloads/sdk-tools-linux-4333796.zip
android-sdk-linux/tools/bin/sdkmanager "build-tools;27.0.3"
android-sdk-linux/tools/bin/sdkmanager "platforms;android-27"
# building with JDK 11 fails currently with javax/xml/something not available
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
mvn -P include-android clean install -DskipTests=true
View PostLargeProblem.java
// for more than 4K locations or for slow network you need to gzip the body
OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(20, TimeUnit.SECONDS);
client.setReadTimeout(20, TimeUnit.SECONDS);
client.interceptors().add(new GzipRequestInterceptor());
....
View test-dedicated.sh
wget -q https://raw.githubusercontent.com/graphhopper/directions-api-js-client/master/route-optimization-examples/vrp_lonlat_new.json -O vrp.json
JOB_ID=$(curl -X POST -H "Content-Type: application/json" "http://localhost:8080/optimize" --data @vrp.json | cut -d'"' -f4)
sleep 2
curl -X GET "http://localhost:8080/solution/$JOB_ID"
View geotester-init.sh
sudo apt-get install python3-venv
python3 -m venv ~/.python-venv/
source ~/.python-venv/bin/activate
git clone https://github.com/geocoders/geocoder-tester
cd geocoder-tester
pip install -r requirements.txt
py.test ...
View preview-git-pull-request.txt
This is a lot easier: https://gist.github.com/piscisaureus/3342247
Step 1: Check out a new branch to test the changes — run this from your project directory
git checkout -b dajac-jsoup-1.7.1 master
Step 2: Bring in dajac's changes and test ('jsoup-1.7.1' acts as commit message)
git pull https://github.com/dajac/snacktory.git jsoup-1.7.1
@piscisaureus
piscisaureus / pr.md
Created Aug 13, 2012
Checkout github pull requests locally
View pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@karussell
karussell / install-elasticsearch-debian
Last active Jun 24, 2016
setup ElasticSearch on EC2
View install-elasticsearch-debian
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.8.deb
sudo dpkg -i elasticsearch-0.19.8.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
# if you want to remove it:
sudo dpkg -r elasticsearch
You can’t perform that action at this time.