- assets and specs can be CoffeeScript
- 3rd party JS can be placed to vendor/assets/javascripts or vendor gems
- detects gem-vendored JS via application.js require
- uses jasmine-headless-webkit to run the suite outside the browser
- this requires Qt4.7 installation
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
curl -s -XPOST localhost:9200/_bulk?pretty=true --data-binary ' | |
{ "index" : { "_index" : "parent_child", "_type" : "store", "_id" : "store1" } } | |
{ "name" : "auchan", "owner" : "chris" } | |
{ "index" : { "_index" : "parent_child", "_type" : "department", "_id" : "department1", "parent" : "store1" } } | |
{ "name" : "toys", "numberOfProducts" : 150 } | |
{ "index" : { "_index" : "parent_child", "_type" : "product", "_id" : "product1", "parent" : "department1", "routing" : "store1" } } | |
{ "name" : "gun", "trademark" : "tiger", "price" : 9, "store_id" : "store1" } | |
' |
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
# Run me with: | |
# | |
# $ nginx -p /path/to/this/file/ -c nginx.conf | |
# | |
# All requests are then routed to authenticated user's index, so | |
# | |
# GET http://user:password@localhost:8080/_search?q=* | |
# | |
# is rewritten to: | |
# |
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
# ======================================== | |
# Testing n-gram analysis in ElasticSearch | |
# ======================================== | |
curl -X DELETE localhost:9200/ngram_test | |
curl -X PUT localhost:9200/ngram_test -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"analysis" : { |
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
curl -s -XPOST localhost:9200/_bulk?pretty=true --data-binary ' | |
{ "index" : { "_index" : "parent_child", "_type" : "store", "_id" : "store1" } } | |
{ "name" : "auchan", "owner" : "chris" } | |
{ "index" : { "_index" : "parent_child", "_type" : "department", "_id" : "department1", "parent" : "store1" } } | |
{ "name" : "toys", "numberOfProducts" : 150 } | |
{ "index" : { "_index" : "parent_child", "_type" : "product", "_id" : "product1", "parent" : "department1", "routing" : "store1" } } | |
{ "name" : "gun", "trademark" : "tiger", "price" : 9, "store_id" : "store1" } | |
' |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
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
<html> | |
<body> | |
<p><%= @options[:title] %></p> | |
<%= import("chapter.html.erb") %> | |
</body> | |
</html> |
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
function WSTestCtrl($scope, ws) { | |
$scope.method = 'ping' | |
$scope.params = '[]' | |
$scope.reply = 'None yet.' | |
$scope.reply_class = 'info' | |
$scope.go = function(){ | |
ws.call($scope.method, JSON.parse($scope.params)).then(function(d){ | |
$scope.reply = JSON.stringify(d) |
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 main | |
// using asymmetric crypto/RSA keys | |
import ( | |
"crypto/rsa" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" |
OlderNewer