This file contains 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
#!/usr/bin/ruby | |
# | |
# find all domains that bit-squat a given domain. | |
# | |
# Based on this article: http://domainincite.com/bit-squatting-%E2%80%93-the-latest-risk-to-domain-name-owners/ | |
# | |
# improvements: use a regex rather than URI.parse | |
require 'uri' |
This file contains 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
(defvar upside-down-alist | |
'((?a . ?ɐ) | |
(?b . ?q) | |
(?c . ?ɔ) | |
(?d . ?p) | |
(?e . ?ǝ) | |
(?f . ?ɟ) | |
(?g . ?ƃ) | |
(?h . ?ɥ) | |
(?i . ?ı) |
This file contains 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
(require 'font-lock) | |
(defvar thrift-mode-hook nil) | |
(add-to-list 'auto-mode-alist '("\\.thrift\\'" . thrift-mode)) | |
(defvar thrift-indent-level 2 | |
"Defines 2 spaces for thrift indentation.") | |
;; syntax coloring |
This file contains 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
(defn counts-per-day [intent-tap] | |
(<- [!intent !bucket !count] | |
(intent-tap _ !intent !ped) | |
(g/extract-true-as-of !ped :> !ms) | |
(o/time-buckets ["d"] !ms :> !bucket) | |
(c/count !count))) | |
(defn avg-sd [counts-per-day-sq min-avg] | |
(<- [!intent !a !sd] | |
(counts-per-day-sq !intent !bucket !count) |
This file contains 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
(let [pedigree (help/mk-pedigree (co/to-long (t/date-time 1979 11 13))) | |
session-path [[1 "http://dopeness.org/" "http://dopeness.org/" 1] | |
[2 "http://dopeness.org/" "http://dopeness.org/3" 3]] | |
pageviews [[1 "http://dopeness.org/" pedigree] | |
[2 "http://dopeness.org/" pedigree] | |
[2 "http://dopeness.org/2" pedigree] | |
[2 "http://dopeness.org/3" pedigree]] | |
visit-types [[1 true pedigree] | |
[2 false pedigree]]] | |
(fact |
This file contains 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 lein-maybe-bug.core | |
(:import leinmaybebug.SomeClass)) | |
(gen-class :name lein-maybe-bug.SomeGenClass | |
:prefix "somegenclass-") | |
(defn somegenclass-test [this] | |
(SomeClass.)) |
This file contains 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 forma.tap; | |
import backtype.hadoop.pail.PailStructure; | |
import java.util.Collections; | |
import java.util.List; | |
import org.apache.thrift.TBase; | |
import org.apache.thrift.TDeserializer; | |
import org.apache.thrift.TException; | |
import org.apache.thrift.TSerializer; |
This file contains 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
(def sample-variance | |
"Predicate macro that calculates the sample variance of the supplied input | |
var." | |
(<- [!val :> !var] | |
(* !val !val :> !squared) | |
(c/sum !squared :> !squared-sum) | |
(c/count !count) | |
(c/sum !val :> !sum) | |
(c/avg !val :> !mean) | |
(* !sum !mean :> !i) |
This file contains 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 ybot.kwphrase-tests | |
(:use [ybot.analytics.ga kwphrase] | |
[ybot datastores] | |
[midje sweet cascalog])) | |
(let [ga-data [["20121025" | |
"http://dopeness.org" | |
"United States" | |
"Oregon" | |
"Portland" |
This file contains 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
(gen-class :name ybot.hadoop.formats.SimpleRecordStreamFactory | |
:implements backtype.hadoop.formats.RecordStreamFactory | |
:prefix "recordfactory-") | |
(defn recordfactory-getInputStream [^FileSystem fs ^Path p] | |
(SimpleInputStream. (.open fs p))) | |
(defn recordfactory-getOutputStream [^FileSystem fs ^Path p] | |
(SimpleOutputStream. (.create fs p))) |