Skip to content

Instantly share code, notes, and snippets.

View johndpope's full-sized avatar

John D. Pope johndpope

View GitHub Profile
@johndpope
johndpope / build-caffe.md
Created May 13, 2016 06:01 — forked from kylemcdonald/build-caffe.md
How to build Caffe for OS X.

Theory of Building Caffe on OS X

Introduction

Our goal is to run python -c "import caffe" without crashing. For anyone who doesn't spend most of their time with build systems, getting to this point can be extremely difficult on OS X. Instead of providing a list of steps to follow, I'll try to epxlain why each step happens.

This page has OS X specific install instructions.

I assume:

@johndpope
johndpope / create_extracts.sh
Created July 25, 2016 17:01 — forked from lukasmartinelli/create_extracts.sh
Create coutnry extracts from world MBTiles
#!/bin/bash
tilelive-copy --minzoom=0 --maxzoom=14 --bounds="60.403889,29.288333,74.989862,38.5899217" world.mbtiles afghanistan.mbtiles
tilelive-copy --minzoom=0 --maxzoom=14 --bounds="19.0246095,39.5448625,21.1574335,42.7611669" world.mbtiles albania.mbtiles
tilelive-copy --minzoom=0 --maxzoom=14 --bounds="-8.7689089,18.868147,12.097337,37.3962055" world.mbtiles algeria.mbtiles
tilelive-copy --minzoom=0 --maxzoom=14 --bounds="1.3135781,42.3288238,1.8863837,42.7559357" world.mbtiles andorra.mbtiles
tilelive-copy --minzoom=0 --maxzoom=14 --bounds="11.3609793,-18.1389449,24.18212,-4.2888889" world.mbtiles angola.mbtiles
tilelive-copy --minzoom=0 --maxzoom=14 --bounds="-63.7391991,17.9609378,-62.6125448,18.8951194" world.mbtiles anguilla.mbtiles
tilelive-copy --minzoom=0 --maxzoom=14 --bounds="-73.6603073,-55.285076,-53.5374514,-21.6811679" world.mbtiles argentina.mbtiles
tilelive-copy --minzoom=0 --maxzoom=14 --bounds="43.3471395,38.7404775,46.7333087,41.400712" world.mbtiles armenia.mbtiles
func relevantEventsForLocation(location: CLLocation, withBlock: ([Event]) -> ()) {
let root = Firebase(url: "https://pikapic.firebaseio.com")
let geoFire = GeoFire(firebaseRef: root)
var circleQuery = geoFire.queryAtLocation(location, withRadius: 0.6)
let span = MKCoordinateSpanMake(0.001, 0.001)
let region = MKCoordinateRegionMake(location.coordinate, span)
var query = geoFire.queryWithRegion(region)
@johndpope
johndpope / Dockerfile
Created October 4, 2016 12:41 — forked from kongou-ae/Dockerfile
Dockerfile
# study
# VERSION 0.1
# MAINTAINER kongou_ae
# use RHEL Atomic
FROM fedora
# import RPM key
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-20-x86_64
@johndpope
johndpope / setup-tensorflow.sh
Created October 10, 2016 01:44 — forked from albertstartup/setup-tensorflow.sh
setup tensorflow on aws
#!/bin/bash
set -o nounset
set -o errexit
git clone https://github.com/tensorflow/tensorflow
sudo apt-get install -y openjdk-8-jdk libcurl4-openssl-dev python3-numpy swig python3-dev python3-pip python3-setuptools zlib1g-dev
echo "deb http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg | sudo apt-key add -
@johndpope
johndpope / group-by-ip.sql
Created October 11, 2016 17:50 — forked from bennadel/group-by-ip.sql
Grouping The MySQL PROCESSLIST By IP Address To View Connection Counts
SELECT
tmp.ipAddress,
-- Calculate how many connections are being held by this IP address.
COUNT( * ) AS ipAddressCount,
-- For each connection, the TIME column represent how many SECONDS it has been in
-- its current state. Running some aggregates will give us a fuzzy picture of what
-- the connections from this IP address is doing.
FLOOR( AVG( tmp.time ) ) AS timeAVG,
@johndpope
johndpope / mysql_kill_queries.sql
Created October 11, 2016 17:55 — forked from ffeast/mysql_kill_queries.sql
Mysql kill queries
/* run \. /tmp/mysql_victims.txt after executing this query */
SELECT
concat('KILL ', id, ';')
FROM
information_schema.processlist
WHERE
user='victim' AND time > 60
INTO OUTFILE '/tmp/mysql_victims.txt';
@johndpope
johndpope / install-tensorflow.sh
Created October 19, 2016 14:00 — forked from erikbern/install-tensorflow.sh
Install TensorFlow on EC2
# Start from ami-763a311e
# Install various packages
sudo apt-get update
sudo apt-get upgrade -y # choose “install package maintainers version”
sudo apt-get install -y build-essential python-pip python-dev git python-numpy swig python-dev default-jdk zip zlib1g-dev
# Install Bazel
git clone https://github.com/bazelbuild/bazel.git
cd bazel
mkdir ~/projects
cd ~/projects
git clone --recurse-submodules https://github.com/petewarden/tensorflow_ios.git tensorflow_ios
cd tensorflow_ios
mkdir tools
mkdir tools/objc
echo '
filegroup(
name = "default_provisioning_profile",
srcs = ["default_provisioning_profile.mobileprovision"],
@johndpope
johndpope / makeGetCall
Created October 20, 2016 16:05 — forked from cmoulton/URLSession Calls in Swift 3.0.1
URLSession Get Call in Swift 3.0
func makeGetCall() {
// Set up the URL request
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1"
guard let url = URL(string: todoEndpoint) else {
print("Error: cannot create URL")
return
}
let urlRequest = URLRequest(url: url)
// set up the session