This gem allows to store carrierwave
uploads in the database, eg. on platforms with ephemeral filesystems like Heroku.
# In: Gemfile
gem 'carrierwave-blob', git: "https://gist.github.com/f1dc8c75d67b92b23a55.git"| #!/usr/bin/env sh | |
| # I've adapted this from the following, which was in turn adapted from the link | |
| # below it: | |
| # * https://raw.github.com/gist/2108403/hack.sh | |
| # * https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)" | |
| # defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 |
This gem allows to store carrierwave
uploads in the database, eg. on platforms with ephemeral filesystems like Heroku.
# In: Gemfile
gem 'carrierwave-blob', git: "https://gist.github.com/f1dc8c75d67b92b23a55.git"| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" /> | |
| <title>Elasticsearch stats analyzer</title> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
| <script type="text/javascript" src="rules.js"></script> | |
| <script type="text/javascript" src="stats.js"></script> | |
| <script type="text/javascript" src="parser.js"></script> | |
| <script type="text/javascript"> |
| curl -XDELETE "localhost:9200/test" | |
| curl -XPUT "localhost:9200/test" -d '{ | |
| "mappings": { | |
| "doc": { | |
| "properties": { | |
| "price": { | |
| "type": "long" | |
| }, | |
| "colour": { | |
| "type": "string", |
| source "http://rubygems.org/" | |
| gem "sinatra", "~> 1.3.0" | |
| gem "thin" |
| module Tire | |
| module Scroll | |
| DEFAULT_SCROLL_DURATION = '1m' | |
| class Scroll | |
| attr_reader :search, :total, :remaining, :counter | |
| def initialize(indices=nil, options={}, &block) | |
| @search = Tire::Search::Search.new(indices, options, &block) | |
| @options = options |
| # ======================================== | |
| # Testing multiple analyzers per field | |
| # ======================================== | |
| # Setup | |
| curl -s -X DELETE 'http://localhost:9200/news_test/' | |
| # Create index with settings and mapping | |
| curl -s -X PUT 'http://localhost:9200/news_test' -d ' | |
| { |
| curl -XPUT ${host}/_template/template_mail -d ' | |
| { | |
| "template" : "*", | |
| "settings" : { | |
| "number_of_shards" : 3, | |
| "number_of_replicas" : 1 | |
| }, | |
| "mappings" : { | |
| "mail" : { | |
| "_index" : { "enabled" : true }, |
| # Setup | |
| curl -X DELETE 'http://localhost:9200/news_cs/' | |
| curl -X DELETE 'http://localhost:9200/news_en/' | |
| # Create Czech and English indices (databases) | |
| curl -X PUT 'http://localhost:9200/news_cs/' | |
| curl -X PUT 'http://localhost:9200/news_en/' | |
| # Create mapping for Czech documents | |
| curl -X PUT 'http://localhost:9200/news_cs/_mapping' -d ' |
| <!DOCTYPE html> | |
| <html> | |
| <!-- This should be the simplest possible jQuery based CouchApp. Install by uploading to a design document in Futon or putting in _attachments/index.html and running `couchapp push` --> | |
| <head><title>Tiny CouchApp</title></head> | |
| <body> | |
| <h1>Tiny CouchApp</h1> | |
| <ul id="databases"></ul> | |
| </body> | |
| <script src="/_utils/script/jquery.js"></script> | |
| <script src="/_utils/script/jquery.couch.js"></script> |