Skip to content

Instantly share code, notes, and snippets.

(ns cascalog-tutorial.core
(:use cascalog.api
cascalog.playground
[clojure.string :only [split]]
[cheshire.core :only [parse-string generate-string]]))
(def input-tap
(hfs-tap (cascading.scheme.hadoop.TextLine.)
(str (System/getProperty "user.dir")
"/all.json")))
@afiore
afiore / index.html
Created January 4, 2011 22:02 — forked from mbostock/.block
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://github.com/simplegeo/polymaps/raw/v2.2.0/polymaps.min.js"></script>
<script type="text/javascript" src="http://github.com/mbostock/polymaps/raw/586fbb0346548a5559b6edea8aab76ac51334da5/lib/crimespotting/crimespotting.js"></script>
<style type="text/css">
@import url("http://github.com/simplegeo/polymaps/raw/v2.2.0/examples/example.css");
html, body {
# Basic text search with relevancy for MongoDB.
# See http://blog.tty.nl/2010/02/08/simple-ranked-text-search-for-mongodb/
# Copythingie 2010 - Ward Bekker - ward@tty.nl
#create (or empty) a docs collection
doc_col = MongoMapper.connection.db('example_db').collection('docs')
doc_col.remove({})
#add some sample data
doc_col.insert({ "txt" => "it is what it is"})
require 'rubygems'
require 'sinatra'
require 'fileutils'
# upload with:
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename
post '/:name/:filename' do
userdir = File.join("files", params[:name])