This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.ambient.cachehours; | |
import android.app.IntentService; | |
import android.content.Intent; | |
import android.content.Context; | |
import android.support.v4.content.LocalBroadcastManager; | |
public class MyIntentService extends IntentService { | |
public MyIntentService() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.ambient.cachehours; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.test.ActivityInstrumentationTestCase2; | |
import android.support.v4.content.LocalBroadcastManager; | |
import android.test.ServiceTestCase; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.ambient.cachehours; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.test.ActivityInstrumentationTestCase2; | |
import android.support.v4.content.LocalBroadcastManager; | |
import java.util.ArrayList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns encounters.geo | |
(:require [geohash.core :as geohash])) | |
(def ^:dynamic *geohash-precision* 1) | |
(def ^:dynamic *radius-km* 6371.009) | |
(defn great-circle-distance | |
([lat lon lat' lon'] | |
(great-circle-distance lat lon lat' lon' *radius-km*)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns encounters.geo | |
(:require [geohash.core :as geohash])) | |
(def ^:dynamic *geohash-precision* 1) | |
(def ^:dynamic *radius-km* 6371.009) | |
(defn great-circle-distance | |
([lat lon lat' lon'] | |
(great-circle-distance lat lon lat' lon' *radius-km*)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns encounters.geo | |
(:require [geohash.core :as geohash])) | |
(def ^:dynamic *geohash-precision* 1) | |
(def ^:dynamic *radius-km* 6371.009) | |
(defn great-circle-distance | |
([lat lon lat' lon'] | |
(great-circle-distance lat lon lat' lon' *radius-km*)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vendor/clojure.el b/vendor/clojure.el | |
index d9cfbd3..884cd66 100644 | |
--- a/vendor/clojure.el | |
+++ b/vendor/clojure.el | |
@@ -13,3 +13,9 @@ | |
(add-hook 'cider-repl-mode-hook 'subword-mode) | |
(add-hook 'cider-repl-mode-hook 'paredit-mode) | |
(add-hook 'cider-repl-mode-hook 'rainbow-delimiters-mode) | |
+ | |
+(defun extend-indent () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro broken | |
[x] | |
(println (into {} (map (fn [[k v]] [(name k) (mapv str v)]) x)))) | |
(broken x x {:a [a] :b [b]} x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random, geohash, guppy, itertools, time | |
def randomHash(): | |
lat = (random.random() * 180) - 90 | |
lng = (random.random() * 360) - 180 | |
return geohash.encode(lat, lng) | |
def insert(d, hash, userId): | |
for c in hash[:11]: | |
d = d.setdefault(c, {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datrie, random, geohash, guppy, time, itertools | |
ghashBase32Chars = '0123456789bcdefghjkmnpqrstuvwxyz' | |
def timeme(func): | |
def wrapper(*arg,**kw): | |
t1 = time.time() | |
res = func(*arg,**kw) | |
t2 = time.time() | |
return (t2-t1), res |