Skip to content

Instantly share code, notes, and snippets.

View johndpope's full-sized avatar

John D. Pope johndpope

View GitHub Profile
@johndpope
johndpope / gist:7796305
Created December 4, 2013 21:56
AFNetworking crash pod 'AFNetworking', '~>1.1.0'
Incident Identifier: 7815290E-1767-461B-A2BC-52391E923EAA
CrashReporter Key: ef45c4038238c05f2a9ccb890dc28eb0aab683e2
Hardware Model: iPhone5,2
Process: Sprint [1836]
Path: /var/mobile/Applications/E2B9E5A0-8243-4882-AABC-B5BA1D07C19D/Sprint.app/Sprint
Identifier: com.gettheworldmoving.sprint
Version: 57 (2.12)
Code Type: ARM (Native)
Parent Process: launchd [1]
extension NSArray {
func bCount() -> Bool {
if(self.count > 0){
return true
}
return false
}
}
import WatchConnectivity
import WatchKit
@available(iOS 9.0, *)
var alertDelegate:HomeIC? = nil
@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 / gist:46a4bb726a38d992d108eba5bb4ac0f2
Last active September 20, 2016 16:34
hybrid xib + snapkit code
// So you have inherited a monolithic complex xib file that extends over 50 constraints.
// You change one constraint only to cause something else unrelated to break.
// The TotalLossTimeDueToIB.com debt increases.
// Xcode upgrades suggests adding more constraints - and slowly the view is becoming harder to juggle.
// It's a don't touch it unless it's broken and want to spend hours fixing it kind of smell.
// Did I mention Xcode is breaking unsatisfiable constraints errors flooding the console?
//
// You wish you could make the break - and throw caution to the wind and use a DSL autolayout language like snapkit but it's
// too much risky to re-write completely. What if there was way in the middle road?
// Instead of ditching the xibs and rolling out ui factory class - what if you could surgically re-wire some of the views to be handled by snapkit and slowly toss out the existing IB constraints. IF so - proceed with caution.
@johndpope
johndpope / Dockerfile
Last active October 19, 2016 20:51
Parsey McParseface - API Dockerfile (osx needs heaps of RAM) https://github.com/dsindex/syntaxnet
# Use this docker-compose.yml file to start services.
# https://github.com/johndpope/DockerParseyAPI
# https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/docker
# https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel
# https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel-gpu
FROM gcr.io/tensorflow/tensorflow:latest-devel
# Use with this Dockerfile https://github.com/johndpope/DockerParseyMcParsefaceAPI
# https://github.com/dsindex/syntaxnet/blob/master/README_api.md
cd /
git clone https://github.com/dsindex/syntaxnet.git work
cd work
git clone --recurse-submodules https://github.com/tensorflow/serving
# checkout proper version of serving
cd serving
@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