This file contains hidden or 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 com.example | |
| import unfiltered.request._ | |
| import unfiltered.response._ | |
| import unfiltered.filter.request._ | |
| class Uploader extends unfiltered.filter.Plan { | |
| def intent = { | |
| case GET(Path("/upload")) => Ok ~> Html( | |
| <html> |
This file contains hidden or 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 controllers | |
| import play.api._ | |
| import play.api.mvc._ | |
| import play.api.libs.json.Json._ | |
| import libs.iteratee.Enumerator | |
| import java.security.MessageDigest | |
| object Application extends Controller { |
This file contains hidden or 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
| cd `which play`/../framework/skeletons/scala-skel/ | |
| wget http://backbonejs.org/backbone-min.js | |
| wget http://underscorejs.org/underscore-min.js | |
| mv backbone-min.js public/javascripts/ | |
| mv underscore-min.js public/javascripts/ | |
| emacs public/javascripts/app.js | |
| (function($){ | |
| var ListView = Backbone.View.extend({ | |
| el: $('body'), | |
| initialize: function(){ |
This file contains hidden or 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
| import org.apache.hadoop.fs.{Path, FileUtil} | |
| import org.apache.mahout.common.iterator.sequencefile.SequenceFileIterable | |
| import org.apache.hadoop.io.Writable | |
| import org.apache.hadoop.conf.Configuration | |
| import java.io.{File, IOException} | |
| import scala.collection.JavaConversions._ | |
| object App { | |
| def main(args: Array[String]) { | |
| val conf = new Configuration |
This file contains hidden or 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
| <?php | |
| require_once '../vendor/autoload.php'; | |
| use Elastica\Client; | |
| use Elastica\Bulk; | |
| use Elastica\Query; | |
| use Elastica\Query\MatchAll; | |
| use Elastica\Query\Term; | |
| use Elastica\Query\QueryString; |
This file contains hidden or 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
| # | |
| # 0.90.3でmapping定義 | |
| # | |
| $ elasticsearch -v | |
| Version: 0.90.3, ... | |
| # jsonのpropertiesの親のkeyをhogeにしてみる | |
| $ cat article.json | |
| { | |
| hoge : { |
This file contains hidden or 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
| PUT /test-index/ | |
| { | |
| "settings": { | |
| "index":{ | |
| "analysis": { | |
| "filter": { | |
| "pos_filter": { | |
| "type": "kuromoji_part_of_speech", | |
| "stoptags": [ | |
| "助詞-格助詞-一般", |
This file contains hidden or 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
| class A | |
| include Mongoid::Document | |
| field :hoge, type: String | |
| before_validation do | |
| p 'before_validation' | |
| end | |
| before_validation on: :create do | |
| p 'before_validation on create' |
This file contains hidden or 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
| class A | |
| include Mongoid::Document | |
| field :hoge, type: String | |
| belongs_to :b | |
| before_validation do | |
| p 'before_validation' | |
| end |
This file contains hidden or 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
| class A | |
| include Mongoid::Document | |
| embeds_many :items | |
| end | |
| class Item | |
| include Mongoid::Document | |
| embedded_in :a | |
| field :text, type: String | |
| end |
OlderNewer