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 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"))) |
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
<!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 { |
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
# 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 - [email protected] | |
#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"}) |
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 '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]) |