This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
| -- building on data from my scenario http://gist.github.com/44489 | |
| -- and bayesian rating http://www.thebroth.com/blog/118/bayesian-rating | |
| assume we have a products table and we want to sort products based on their rating. | |
| With bayesian rating, you get better weighting, so that a single 5 star vote won't show up as "top product" | |
| select * from products; | |
| mysql> select * from products; | |
| +------+--------+---------------+--------------+---------+ | |
| | id | name | ratings_count | total_rating | weight | |
| <?php | |
| if(!class_exists('Rhaco')) require_once 'rhaco/Rhaco.php'; | |
| Rhaco::import('network.http.Browser'); | |
| class AmazonReport | |
| { | |
| var $base_url = 'https://affiliate.amazon.co.jp'; | |
| var $browser; | |
| function AmazonReport($email, $password){ |
| <?php | |
| use Doctrine\ORM\Mapping\ClassMetadataInfo; | |
| $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE); | |
| $metadata->setPrimaryTable(array( | |
| 'name' => 'cms_users', | |
| )); | |
| $metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); | |
| $metadata->addLifecycleCallback('doStuffOnPrePersist', 'prePersist'); |
| # ======================================== | |
| # Testing n-gram analysis in ElasticSearch | |
| # ======================================== | |
| curl -X DELETE localhost:9200/ngram_test | |
| curl -X PUT localhost:9200/ngram_test -d ' | |
| { | |
| "settings" : { | |
| "index" : { | |
| "analysis" : { |
| // Config | |
| { | |
| "index" : { | |
| "analysis" : { | |
| "filter" : { | |
| "my_ngram" : { | |
| "max_gram" : 20, | |
| "min_gram" : 2, | |
| "type" : "nGram" | |
| } |
| #!/bin/bash | |
| # <UDF name="ssh_key" Label="Paste in your public SSH key" default="" example="" optional="false" /> | |
| # root ssh keys | |
| mkdir /root/.ssh | |
| echo $SSH_KEY >> /root/.ssh/authorized_keys | |
| chmod 0700 /root/.ssh | |
| # update to latest |
| .idea/* | |
| *.pyc |
| # Index | |
| --------------------------------------------------------------------- | |
| curl -XPUT http://localhost:9200/pictures/ -d ' | |
| { | |
| "settings": { | |
| "analysis": { | |
| "analyzer": { | |
| "index_analyzer": { | |
| "tokenizer": "standard", |
| <?php | |
| /* | |
| * This file is part of the Symfony package. | |
| * | |
| * (c) Fabien Potencier <[email protected]> | |
| * | |
| * For the full copyright and license information, please view the LICENSE | |
| * file that was distributed with this source code. | |
| */ |